test / app.py
Zoltan100's picture
my latest updates…
7217a85
raw
history blame contribute delete
543 Bytes
# https://huggingface.co/spaces/Zoltan100/test
# import gradio as gr
#
# def greet(name):
# return "Hello " + name + "!!"
#
# demo = gr.Interface(fn=greet, inputs="text", outputs="text")
# demo.launch()
import gradio as gr
from transformers import pipeline
model = pipeline("sentiment-analysis")
# Define inference function
def predict(text):
outputs = model(text)
return outputs
# Create Gradio interface
demo = gr.Interface(
fn=predict,
inputs="text", outputs="text",
title="Sentiment Analysis"
)
demo.launch()