Spaces:
Running on Zero
Running on Zero
Commit ·
347f71b
1
Parent(s): c3b7b4c
Remove Docker files; fix CPU-only torch for Gradio SDK space
Browse filesDrop Dockerfile, docker-compose.yml, .dockerignore.
Add --extra-index-url for PyTorch CPU wheel so HF installs the
lightweight CPU build instead of the 2.5 GB CUDA package.
- .dockerignore +0 -12
- Dockerfile +0 -32
- docker-compose.yml +0 -19
- requirements.txt +1 -0
.dockerignore
DELETED
|
@@ -1,12 +0,0 @@
|
|
| 1 |
-
.git
|
| 2 |
-
.venv
|
| 3 |
-
.env
|
| 4 |
-
__pycache__
|
| 5 |
-
*.pyc
|
| 6 |
-
*.db
|
| 7 |
-
.claude
|
| 8 |
-
CLAUDE.md
|
| 9 |
-
AGENTS.md
|
| 10 |
-
my-notes
|
| 11 |
-
docs
|
| 12 |
-
*.ipynb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dockerfile
DELETED
|
@@ -1,32 +0,0 @@
|
|
| 1 |
-
FROM python:3.12-slim
|
| 2 |
-
|
| 3 |
-
WORKDIR /app
|
| 4 |
-
|
| 5 |
-
# Install system dependencies required by torch and transformers
|
| 6 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
-
build-essential \
|
| 8 |
-
git \
|
| 9 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
-
|
| 11 |
-
# Install CPU-only torch first to keep image lean, then remaining deps
|
| 12 |
-
COPY requirements.txt .
|
| 13 |
-
RUN pip install --no-cache-dir torch>=2.2.0 --index-url https://download.pytorch.org/whl/cpu \
|
| 14 |
-
&& pip install --no-cache-dir -r requirements.txt
|
| 15 |
-
|
| 16 |
-
# Copy application code
|
| 17 |
-
COPY app.py config.py ./
|
| 18 |
-
COPY core/ core/
|
| 19 |
-
COPY db/ db/
|
| 20 |
-
COPY models/ models/
|
| 21 |
-
COPY ui/ ui/
|
| 22 |
-
|
| 23 |
-
# HuggingFace model cache is stored under /data so it can be mounted as a
|
| 24 |
-
# volume and downloaded weights survive container restarts.
|
| 25 |
-
ENV HF_HOME=/data/hf_cache \
|
| 26 |
-
PORT=7860
|
| 27 |
-
|
| 28 |
-
VOLUME /data
|
| 29 |
-
|
| 30 |
-
EXPOSE 7860
|
| 31 |
-
|
| 32 |
-
CMD ["python", "app.py"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docker-compose.yml
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
networks:
|
| 2 |
-
hf-build-small:
|
| 3 |
-
driver: bridge
|
| 4 |
-
|
| 5 |
-
volumes:
|
| 6 |
-
tinypress-data:
|
| 7 |
-
|
| 8 |
-
services:
|
| 9 |
-
tinypress:
|
| 10 |
-
build: .
|
| 11 |
-
ports:
|
| 12 |
-
- "7860:7860"
|
| 13 |
-
volumes:
|
| 14 |
-
- tinypress-data:/data
|
| 15 |
-
env_file:
|
| 16 |
-
- .env
|
| 17 |
-
networks:
|
| 18 |
-
- hf-build-small
|
| 19 |
-
restart: unless-stopped
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
gradio==6.18.0
|
| 2 |
transformers>=4.40.0
|
| 3 |
sentence-transformers>=3.0.0
|
|
|
|
| 1 |
+
--extra-index-url https://download.pytorch.org/whl/cpu
|
| 2 |
gradio==6.18.0
|
| 3 |
transformers>=4.40.0
|
| 4 |
sentence-transformers>=3.0.0
|