import gradio as gr from transformers import pipeline def sentiment(name): out = pipe(text) return out pipe = pipeline("sentiment-analysis") iface = gr.Interface(fn=sentiment, inputs="text", outputs="text") iface.launch()