Spaces:
Runtime error
Runtime error
Download app.py from Salahudheen007/FirstApp: direct link, hf CLI and curl.
- Browser
- Download file 430 Bytes
-
https://huggingface.co/spaces/Salahudheen007/FirstApp/resolve/main/app.py
- Command line
-
hf download hf://spaces/Salahudheen007/FirstApp/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Salahudheen007/FirstApp/resolve/main/app.py
430 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| sentiment_pipeline = pipeline("sentiment-analysis") | |
| def get_sentiment(input_text): | |
| result = sentiment_pipeline(input_text) | |
| return result[0]['label'] | |
| #launch the Web UI | |
| iface = gr.Interface( | |
| fn = get_sentiment, | |
| inputs = "text", | |
| outputs = "text", | |
| title = "First App", | |
| description = "Enter some text I'll tell positive or negative" | |
| ) | |
| iface.launch() | |