Download app.py from rydrbot/TestApp: direct link, hf CLI and curl.
- Browser
- Download file 435 Bytes
-
https://huggingface.co/spaces/rydrbot/TestApp/resolve/main/app.py
- Command line
-
hf download hf://spaces/rydrbot/TestApp/app.py
-
curl -L -o app.py https://huggingface.co/spaces/rydrbot/TestApp/resolve/main/app.py
435 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'] | |
| iface = gr.Interface( | |
| fn = get_sentiment, | |
| inputs = "text", outputs = "text", | |
| title = "My first AI App", | |
| description = "Enter some text and I'll tell you whether it is positive or negative" | |
| ) | |
| iface.launch() |