Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from transformers import pipeline | |
| # Load model | |
| classifier = pipeline("sentiment-analysis", model="Carsoleong/babi") | |
| # Define inference function | |
| def predict(text): | |
| return classifier(text) | |
| # Define Gradio interface | |
| interface = gr.Interface(fn=predict, inputs="text", outputs="label", title="Sentiment Classifier") | |
| interface.launch() | |