Spaces:
Configuration error
Configuration error
Dash + Hugging Face Demo
This is a demo application showcasing how to use Dash with Hugging Face models deployed on Hugging Face Spaces using Docker.
Features
- Sentiment Analysis: Analyze the sentiment of text using a pre-trained model
- Text Generation: Generate text based on prompts using GPT-2
- Interactive Visualizations: View sentiment analysis results with Plotly charts
- Responsive Design: Bootstrap-based UI that works on all devices
Models Used
- Sentiment Analysis:
cardiffnlp/twitter-roberta-base-sentiment-latest
- Text Generation:
gpt2
Local Development
- Clone this repository
- Install dependencies:
pip install -r requirements.txt
- Run the app:
python app.py
- Open your browser to
http://localhost:7860
Deployment on Hugging Face Spaces
This app is configured to run on Hugging Face Spaces using Docker:
- The Dockerfile sets up the Python environment
- Port 7860 is exposed (required by HF Spaces)
- Models are loaded automatically when the container starts
File Structure
βββ app.py # Main Dash application
βββ requirements.txt # Python dependencies
βββ Dockerfile # Docker configuration
βββ README.md # This file
Configuration
The app automatically detects when running on Hugging Face Spaces and configures itself accordingly. No additional setup is required.