Spaces:
Configuration error
Configuration error
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,10 +1,43 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
--
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dash + Hugging Face Demo
|
| 2 |
+
|
| 3 |
+
This is a demo application showcasing how to use Dash with Hugging Face models deployed on Hugging Face Spaces using Docker.
|
| 4 |
+
|
| 5 |
+
## Features
|
| 6 |
+
|
| 7 |
+
- **Sentiment Analysis**: Analyze the sentiment of text using a pre-trained model
|
| 8 |
+
- **Text Generation**: Generate text based on prompts using GPT-2
|
| 9 |
+
- **Interactive Visualizations**: View sentiment analysis results with Plotly charts
|
| 10 |
+
- **Responsive Design**: Bootstrap-based UI that works on all devices
|
| 11 |
+
|
| 12 |
+
## Models Used
|
| 13 |
+
|
| 14 |
+
- Sentiment Analysis: `cardiffnlp/twitter-roberta-base-sentiment-latest`
|
| 15 |
+
- Text Generation: `gpt2`
|
| 16 |
+
|
| 17 |
+
## Local Development
|
| 18 |
+
|
| 19 |
+
1. Clone this repository
|
| 20 |
+
2. Install dependencies: `pip install -r requirements.txt`
|
| 21 |
+
3. Run the app: `python app.py`
|
| 22 |
+
4. Open your browser to `http://localhost:7860`
|
| 23 |
+
|
| 24 |
+
## Deployment on Hugging Face Spaces
|
| 25 |
+
|
| 26 |
+
This app is configured to run on Hugging Face Spaces using Docker:
|
| 27 |
+
|
| 28 |
+
1. The Dockerfile sets up the Python environment
|
| 29 |
+
2. Port 7860 is exposed (required by HF Spaces)
|
| 30 |
+
3. Models are loaded automatically when the container starts
|
| 31 |
+
|
| 32 |
+
## File Structure
|
| 33 |
+
|
| 34 |
+
```
|
| 35 |
+
βββ app.py # Main Dash application
|
| 36 |
+
βββ requirements.txt # Python dependencies
|
| 37 |
+
βββ Dockerfile # Docker configuration
|
| 38 |
+
βββ README.md # This file
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
## Configuration
|
| 42 |
+
|
| 43 |
+
The app automatically detects when running on Hugging Face Spaces and configures itself accordingly. No additional setup is required.
|