sam0303's picture
Create app.py
6eb0648
raw
history blame
488 Bytes
! pip install transformers
! pip install gradio
from transformers import pipeline
import gradio as gr
classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
def zshot (text, labels):
result = ([text, classifier(text, labels)['labels'][0]])
return(result)
app = gr.Interface(
zshot,
inputs=[
gr.Textbox(label="Text", value=""),
gr.Textbox(label="Label", value="['Food,Travel,Movie']"),
],
outputs=["text"],
)
app.launch()