Spaces:
Runtime error
Runtime error
pip install gradio transformers | |
import gradio as gr | |
from transformers import pipeline | |
text_classifier = pipeline('sentiment-analysis') | |
def predict(text): | |
result = text_classifier(text) | |
return result[0]['label'] | |
iface = gr.Interface( | |
fn=predict, | |
inputs=gr.Textbox(), | |
outputs=gr.Textbox() | |
) | |
iface = gr.Interface( | |
fn=predict, | |
inputs=gr.Textbox(), | |
outputs=gr.Textbox() | |
) | |
iface.launch() | |