Spaces:
Sleeping
Sleeping
Download app.py from flyingdc/playground: direct link, hf CLI and curl.
- Browser
- Download file 308 Bytes
-
https://huggingface.co/spaces/flyingdc/playground/resolve/main/app.py
- Command line
-
hf download hf://spaces/flyingdc/playground/app.py
-
curl -L -o app.py https://huggingface.co/spaces/flyingdc/playground/resolve/main/app.py
308 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| classifier = pipeline("sentiment-analysis") | |
| def predict_sentiment(text): | |
| result = classifier(text) | |
| return result[0]['label'] | |
| iface = gr.Interface(fn=predict_sentiment, inputs="text", outputs="text", title = 'Sentiment Analysis') | |
| iface.launch() |