from transformers import pipeline import gradio as gr pipe = pipeline("text-classification", model="michellejieli/emotion_text_classifier") def predict_emotion(text): result = pipe(text)[0] return result["label"] gr.Interface( fn=predict_emotion, inputs="text", outputs="text", title="Emotion Text Classifier" ).launch()