Spaces:
Sleeping
Sleeping
File size: 415 Bytes
163f8e3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import gradio as gr
from transformers import pipeline
# Load the pre-trained model
model = pipeline("text-classification", model="hasanmustafa0503/SentimentModel")
# Define the inference function
def predict_sentiment(text):
result = model(text)
return result
# Create a Gradio interface
interface = gr.Interface(fn=predict_sentiment, inputs="text", outputs="json")
# Launch the app
interface.launch() |