wendys-llc's picture
Update app.py
18418b8
raw
history blame
449 Bytes
import gradio as gr
from transformers import pipeline
def greet(text):
classifier = pipeline("zero-shot-classification",
model="facebook/bart-large-mnli")
candidate_labels = ['gun control', 'abortion', 'gender transition', 'freedom of speech', 'immigration', 'taxes']
result = classifier(text, candidate_labels)
return result
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()