emotions / app.py
Lord-Raven
Messing with return value.
64af10f
raw
history blame
381 Bytes
import gradio as gr
from transformers import pipeline
classifier = pipeline("text-classification", model="SamLowe/roberta-base-go_emotions")
def predict(text):
result = classifier(text)
print(f"{result}")
return result
demo = gr.Interface(
fn = predict,
inputs = 'text',
outputs = 'text',
)
# demo = gr.Interface.from_pipeline(classifier)
demo.launch()