import gradio as gr | |
from transformers import pipeline | |
pipe = pipeline("sentiment", model="enio/Sentiment_BERT") | |
def predict(text): | |
return pipe(text)[0]["sentiment_text"] | |
iface = gr.Interface( | |
fn=predict, | |
inputs='text', | |
outputs='text', | |
examples=[["This is Awesome!"]] | |
) | |
iface.launch() |