lg3394's picture
Update app.py
7258dcc verified
raw
history blame
389 Bytes
import gradio as gr
from transformers import pipeline
classifier = pipeline("zero-shot-classification",
model="facebook/bart-large-mnli")
def do_action(text):
candidate_labels = ['travel', 'cooking', 'dancing']
result = classifier(text, candidate_labels)
return result
iface = gr.Interface(fn=do_action, inputs="text", outputs="text")
iface.launch()