demo-app-gradio / app.py
akuysal's picture
Update app.py
080ae89
raw
history blame
287 Bytes
# gradio demo
import gradio as gr
from transformers import pipeline
pipe = pipeline("sentiment-analysis")
def predict(text):
return pipe(text)[0]["label"]
iface = gr.Interface(
fn=predict,
inputs='text',
outputs='text',
examples=[["The movie was amazing"]]
)
iface.launch()