Spaces:
Runtime error
Runtime error
Download app.py from davoodwadi/Sentiment-Bot: direct link, hf CLI and curl.
- Browser
- Download file 392 Bytes
-
https://huggingface.co/spaces/davoodwadi/Sentiment-Bot/resolve/main/app.py
- Command line
-
hf download hf://spaces/davoodwadi/Sentiment-Bot/app.py
-
curl -L -o app.py https://huggingface.co/spaces/davoodwadi/Sentiment-Bot/resolve/main/app.py
392 Bytes
| import gradio as gr | |
| import numpy as np | |
| def get_sentiment(Review, satisfied): | |
| # Get sentiment from LLM | |
| if satisfied: | |
| Sentiment = 'Positive' | |
| else: | |
| Sentiment = np.random.choice(['Positive', 'Negative']) | |
| return Sentiment | |
| demo = gr.Interface(fn=get_sentiment, inputs=["textbox", 'checkbox'], outputs="textbox") | |
| if __name__ == "__main__": | |
| demo.launch() |