Spaces:
Runtime error
Runtime error
Download app.py from Suhani0409/AWS: direct link, hf CLI and curl.
- Browser
- Download file 414 Bytes
-
https://huggingface.co/spaces/Suhani0409/AWS/resolve/main/app.py
- Command line
-
hf download hf://spaces/Suhani0409/AWS/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Suhani0409/AWS/resolve/main/app.py
414 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| # Load sentiment model | |
| classifier = pipeline("sentiment-analysis") | |
| def analyze_sentiment(text): | |
| result = classifier(text) | |
| return result[0] | |
| interface = gr.Interface( | |
| fn=analyze_sentiment, | |
| inputs="text", | |
| outputs="label", | |
| title="Sentiment Analysis App", | |
| description="Analyze sentiment using Hugging Face model" | |
| ) | |
| interface.launch() |