sentiment-api / app.py
hasanmustafa0503's picture
Create app.py
e8e9561 verified
raw
history blame
269 Bytes
import gradio as gr
from transformers import pipeline
classifier = pipeline("text-classification", model="hasanmustafa0503/SentimentModel")
def predict(text):
return classifier(text)
iface = gr.Interface(fn=predict, inputs="text", outputs="json")
iface.launch()