File size: 388 Bytes
31a7455
5d00e2d
31a7455
5d00e2d
 
 
 
 
 
 
 
31a7455
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import gradio as gr
from transformers import pipeline

def greet(text):
    classifier = pipeline("zero-shot-classification",
                          model="facebook/bart-large-mnli")

    candidate_labels = ['travel', 'cooking', 'dancing']
    result = classifier(text, candidate_labels)

    return result

iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()