File size: 381 Bytes
bb22eb8 2dc242a 5f09d1f 0388cf1 56b5d66 64af10f 56b5d66 0388cf1 5f09d1f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
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() |