Add Docker support for Hugging Face Spaces deployment
Browse files- .dockerignore +27 -0
- .streamlit/config.toml +6 -0
- Dockerfile +29 -0
- README.md +23 -0
- packages.txt +0 -0
.dockerignore
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__pycache__
|
| 2 |
+
*.pyc
|
| 3 |
+
*.pyo
|
| 4 |
+
*.pyd
|
| 5 |
+
.Python
|
| 6 |
+
env/
|
| 7 |
+
venv/
|
| 8 |
+
.venv
|
| 9 |
+
pip-log.txt
|
| 10 |
+
pip-delete-this-directory.txt
|
| 11 |
+
.tox/
|
| 12 |
+
.coverage
|
| 13 |
+
.coverage.*
|
| 14 |
+
.cache
|
| 15 |
+
nosetests.xml
|
| 16 |
+
coverage.xml
|
| 17 |
+
*.cover
|
| 18 |
+
*.log
|
| 19 |
+
.git
|
| 20 |
+
.gitignore
|
| 21 |
+
.mypy_cache
|
| 22 |
+
.pytest_cache
|
| 23 |
+
.hypothesis
|
| 24 |
+
*.md
|
| 25 |
+
!README.md
|
| 26 |
+
LICENSE.md
|
| 27 |
+
link.txt
|
.streamlit/config.toml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[server]
|
| 2 |
+
headless = true
|
| 3 |
+
port = 7860
|
| 4 |
+
|
| 5 |
+
[browser]
|
| 6 |
+
gatherUsageStats = false
|
Dockerfile
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# Install system dependencies
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
+
build-essential \
|
| 8 |
+
curl \
|
| 9 |
+
software-properties-common \
|
| 10 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
+
|
| 12 |
+
# Copy requirements first for better caching
|
| 13 |
+
COPY requirements.txt .
|
| 14 |
+
|
| 15 |
+
# Install Python dependencies
|
| 16 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
+
|
| 18 |
+
# Copy application files
|
| 19 |
+
COPY app.py .
|
| 20 |
+
COPY .streamlit .streamlit
|
| 21 |
+
|
| 22 |
+
# Expose port 7860 (Hugging Face Spaces default)
|
| 23 |
+
EXPOSE 7860
|
| 24 |
+
|
| 25 |
+
# Health check
|
| 26 |
+
HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health
|
| 27 |
+
|
| 28 |
+
# Run the Streamlit app
|
| 29 |
+
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
| 2 |
|
| 3 |
Psychometric Template Generator is a data visualization tool built using Python, Streamlit, Pandas, Matplotlib, and Plotly. It allows users to upload a CSV file and create intutive data visualizations just by selecting the features from the data.
|
| 4 |
|
|
|
|
|
|
|
| 5 |
## ✨ Features
|
| 6 |
|
| 7 |
- Upload CSV data: Allows users to upload CSV files containing the data for psychometric testing.
|
|
@@ -40,3 +42,24 @@ Psychometric Template Generator is a data visualization tool built using Python,
|
|
| 40 |
3. Select features from the data.
|
| 41 |
4. Select the Visualization from the given visualization charts and plots.
|
| 42 |
5. You're Done, You'll get the visualization from selected features.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
Psychometric Template Generator is a data visualization tool built using Python, Streamlit, Pandas, Matplotlib, and Plotly. It allows users to upload a CSV file and create intutive data visualizations just by selecting the features from the data.
|
| 4 |
|
| 5 |
+
🚀 **Live Demo**: [View on Hugging Face Spaces](https://huggingface.co/spaces/aniket47/Advance-Data-Visualization-Tool)
|
| 6 |
+
|
| 7 |
## ✨ Features
|
| 8 |
|
| 9 |
- Upload CSV data: Allows users to upload CSV files containing the data for psychometric testing.
|
|
|
|
| 42 |
3. Select features from the data.
|
| 43 |
4. Select the Visualization from the given visualization charts and plots.
|
| 44 |
5. You're Done, You'll get the visualization from selected features.
|
| 45 |
+
|
| 46 |
+
## 🐳 Docker Deployment
|
| 47 |
+
|
| 48 |
+
### Run with Docker locally:
|
| 49 |
+
```bash
|
| 50 |
+
docker build -t data-viz-tool .
|
| 51 |
+
docker run -p 7860:7860 data-viz-tool
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
Then open your browser to `http://localhost:7860`
|
| 55 |
+
|
| 56 |
+
### Deploy to Hugging Face Spaces:
|
| 57 |
+
1. Create a new Space at [huggingface.co/new-space](https://huggingface.co/new-space)
|
| 58 |
+
2. Select **Docker** as the SDK
|
| 59 |
+
3. Push your code to the Space repository:
|
| 60 |
+
```bash
|
| 61 |
+
git remote add space https://huggingface.co/spaces/aniket47/Advance-Data-Visualization-Tool
|
| 62 |
+
git add .
|
| 63 |
+
git commit -m "Add Docker support for HF Spaces"
|
| 64 |
+
git push space main
|
| 65 |
+
```
|
packages.txt
ADDED
|
File without changes
|