babispace / app.py
Carsoleong's picture
Upload Gradio app
73e3c19
raw
history blame contribute delete
359 Bytes
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()