Spaces:
Sleeping
Sleeping
Download app.py from SteevAbrahamThomas/First_Space: direct link, hf CLI and curl.
- Browser
- Download file 392 Bytes
-
https://huggingface.co/spaces/SteevAbrahamThomas/First_Space/resolve/main/app.py
- Command line
-
hf download hf://spaces/SteevAbrahamThomas/First_Space/app.py
-
curl -L -o app.py https://huggingface.co/spaces/SteevAbrahamThomas/First_Space/resolve/main/app.py
392 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='My first AI app', | |
| description='Enter Some Text' | |
| ) | |
| iface.launch() |