Upload folder using huggingface_hub
Browse files- .dockerignore +58 -0
- Dockerfile +46 -11
- README.md +2 -3
- app/__pycache__/__init__.cpython-314.pyc +0 -0
.dockerignore
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Git files
|
| 2 |
+
.git
|
| 3 |
+
.gitignore
|
| 4 |
+
.gitattributes
|
| 5 |
+
|
| 6 |
+
# Python cache
|
| 7 |
+
__pycache__/
|
| 8 |
+
*.py[cod]
|
| 9 |
+
*$py.class
|
| 10 |
+
*.so
|
| 11 |
+
.Python
|
| 12 |
+
|
| 13 |
+
# Virtual environments
|
| 14 |
+
venv/
|
| 15 |
+
env/
|
| 16 |
+
ENV/
|
| 17 |
+
|
| 18 |
+
# IDEs
|
| 19 |
+
.vscode/
|
| 20 |
+
.idea/
|
| 21 |
+
*.swp
|
| 22 |
+
*.swo
|
| 23 |
+
*~
|
| 24 |
+
|
| 25 |
+
# OS files
|
| 26 |
+
.DS_Store
|
| 27 |
+
Thumbs.db
|
| 28 |
+
|
| 29 |
+
# Workspace and temp files
|
| 30 |
+
workspace/
|
| 31 |
+
tmp/
|
| 32 |
+
temp/
|
| 33 |
+
*.tmp
|
| 34 |
+
|
| 35 |
+
# Logs
|
| 36 |
+
*.log
|
| 37 |
+
logs/
|
| 38 |
+
|
| 39 |
+
# Backup files
|
| 40 |
+
*_backup.*
|
| 41 |
+
*.bak
|
| 42 |
+
|
| 43 |
+
# Large files that aren't needed
|
| 44 |
+
assets/
|
| 45 |
+
examples/
|
| 46 |
+
tests/
|
| 47 |
+
.pytest_cache/
|
| 48 |
+
|
| 49 |
+
# Documentation (keep only README.md)
|
| 50 |
+
*.md
|
| 51 |
+
!README.md
|
| 52 |
+
|
| 53 |
+
# Config examples
|
| 54 |
+
config/config.example*.toml
|
| 55 |
+
|
| 56 |
+
# Deployment docs
|
| 57 |
+
DEPLOYMENT_*.md
|
| 58 |
+
docker-commands.md
|
Dockerfile
CHANGED
|
@@ -1,22 +1,57 @@
|
|
| 1 |
-
# HuggingFace
|
| 2 |
-
FROM
|
| 3 |
|
| 4 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
RUN useradd -m -u 1000 user
|
|
|
|
|
|
|
| 6 |
USER user
|
|
|
|
|
|
|
| 7 |
ENV HOME=/home/user \
|
| 8 |
PATH=/home/user/.local/bin:$PATH
|
| 9 |
|
| 10 |
# Set working directory
|
| 11 |
-
WORKDIR /app
|
| 12 |
|
| 13 |
-
#
|
|
|
|
|
|
|
|
|
|
| 14 |
COPY --chown=user requirements.txt .
|
| 15 |
-
RUN
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
|
|
|
|
| 20 |
|
| 21 |
-
# Run
|
| 22 |
-
CMD ["
|
|
|
|
| 1 |
+
# Use NVIDIA CUDA base image for GPU support on HuggingFace Spaces
|
| 2 |
+
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
|
| 3 |
|
| 4 |
+
# Set environment variables
|
| 5 |
+
ENV DEBIAN_FRONTEND=noninteractive \
|
| 6 |
+
PYTHONUNBUFFERED=1 \
|
| 7 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
| 8 |
+
GRADIO_SERVER_PORT=7860
|
| 9 |
+
|
| 10 |
+
# Install system dependencies
|
| 11 |
+
RUN apt-get update && apt-get install -y \
|
| 12 |
+
python3.10 \
|
| 13 |
+
python3-pip \
|
| 14 |
+
git \
|
| 15 |
+
curl \
|
| 16 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
+
|
| 18 |
+
# Create symbolic link for python
|
| 19 |
+
RUN ln -s /usr/bin/python3.10 /usr/bin/python
|
| 20 |
+
|
| 21 |
+
# Set up user with ID 1000 (required by HuggingFace Spaces)
|
| 22 |
RUN useradd -m -u 1000 user
|
| 23 |
+
|
| 24 |
+
# Switch to user
|
| 25 |
USER user
|
| 26 |
+
|
| 27 |
+
# Set home and path
|
| 28 |
ENV HOME=/home/user \
|
| 29 |
PATH=/home/user/.local/bin:$PATH
|
| 30 |
|
| 31 |
# Set working directory
|
| 32 |
+
WORKDIR $HOME/app
|
| 33 |
|
| 34 |
+
# Upgrade pip
|
| 35 |
+
RUN pip3 install --no-cache-dir --upgrade pip
|
| 36 |
+
|
| 37 |
+
# Copy requirements and install (fix NumPy version first)
|
| 38 |
COPY --chown=user requirements.txt .
|
| 39 |
+
RUN pip3 install --no-cache-dir "numpy<2" && \
|
| 40 |
+
pip3 install --no-cache-dir -r requirements.txt
|
| 41 |
+
|
| 42 |
+
# Copy application files
|
| 43 |
+
COPY --chown=user app.py .
|
| 44 |
+
COPY --chown=user README.md .
|
| 45 |
+
|
| 46 |
+
# Create data directory for persistent storage
|
| 47 |
+
RUN mkdir -p $HOME/app/data
|
| 48 |
+
|
| 49 |
+
# Expose Gradio port
|
| 50 |
+
EXPOSE 7860
|
| 51 |
|
| 52 |
+
# Health check
|
| 53 |
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
| 54 |
+
CMD curl -f http://localhost:7860/ || exit 1
|
| 55 |
|
| 56 |
+
# Run the Gradio application
|
| 57 |
+
CMD ["python3", "app.py"]
|
README.md
CHANGED
|
@@ -3,9 +3,8 @@ title: ORYNXML Complete AI Platform
|
|
| 3 |
emoji: 🤖
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: indigo
|
| 6 |
-
sdk:
|
| 7 |
-
|
| 8 |
-
app_file: app.py
|
| 9 |
pinned: true
|
| 10 |
license: apache-2.0
|
| 11 |
short_description: Complete AI Platform with 211 models across 8 categories
|
|
|
|
| 3 |
emoji: 🤖
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: indigo
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_port: 7860
|
|
|
|
| 8 |
pinned: true
|
| 9 |
license: apache-2.0
|
| 10 |
short_description: Complete AI Platform with 211 models across 8 categories
|
app/__pycache__/__init__.cpython-314.pyc
ADDED
|
Binary file (585 Bytes). View file
|
|
|