import gradio as gr | |
from transformers import pipeline | |
classifier = pipeline("text-classification", model="SamLowe/roberta-base-go_emotions") | |
def predict(text): | |
return classifier(text) | |
demo = gr.Interface( | |
fn=predict, | |
inputs='text', | |
outputs='result', | |
) | |
demo.launch() |