Spaces:
Running
Running
Commit ยท
4879fbd
1
Parent(s): 519d26c
Install CPU-only torch to fix HF cpu-basic startup stall
Browse filesDefault pip install torch==2.9.0 pulls the CUDA wheel (~5-7GB nvidia-*-cu12),
bloating the image and stalling startup on cpu-basic. Install torch==2.9.0+cpu
from the PyTorch CPU index first; the requirements pin is then satisfied.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Dockerfile +4 -0
- requirements.txt +2 -0
Dockerfile
CHANGED
|
@@ -22,7 +22,11 @@ WORKDIR /app
|
|
| 22 |
|
| 23 |
# Cache pip layer separately from source so model changes don't trigger reinstall.
|
| 24 |
COPY requirements.txt ./
|
|
|
|
|
|
|
|
|
|
| 25 |
RUN pip install --upgrade pip \
|
|
|
|
| 26 |
&& pip install -r requirements.txt
|
| 27 |
|
| 28 |
# Copy the rest (app code, frontend, weights, baseline artifact).
|
|
|
|
| 22 |
|
| 23 |
# Cache pip layer separately from source so model changes don't trigger reinstall.
|
| 24 |
COPY requirements.txt ./
|
| 25 |
+
# CPU ์ ์ฉ torch wheel ์ ๋จผ์ ์ค์นํ๋ค. ๊ธฐ๋ณธ PyPI ์ torch ๋ nvidia-*-cu12
|
| 26 |
+
# (~5-7GB) ๋ฅผ ๋๊ณ ์ ์ด๋ฏธ์ง๊ฐ ๋น๋ํด์ง๊ณ cpu-basic ๋
ธ๋์์ ๊ธฐ๋์ด ์ง์ฐ/์คํจํ๋ค.
|
| 27 |
+
# torch==2.9.0+cpu ๋ ์๋ requirements ์ `torch==2.9.0` ์ ์ด๋ฏธ ์ถฉ์กฑํ๋ฏ๋ก ์ฌ์ค์น ์์.
|
| 28 |
RUN pip install --upgrade pip \
|
| 29 |
+
&& pip install --no-cache-dir torch==2.9.0 --index-url https://download.pytorch.org/whl/cpu \
|
| 30 |
&& pip install -r requirements.txt
|
| 31 |
|
| 32 |
# Copy the rest (app code, frontend, weights, baseline artifact).
|
requirements.txt
CHANGED
|
@@ -4,6 +4,8 @@
|
|
| 4 |
numpy==2.1.3
|
| 5 |
pandas==2.2.3
|
| 6 |
scipy>=1.11
|
|
|
|
|
|
|
| 7 |
torch==2.9.0
|
| 8 |
|
| 9 |
# Web server
|
|
|
|
| 4 |
numpy==2.1.3
|
| 5 |
pandas==2.2.3
|
| 6 |
scipy>=1.11
|
| 7 |
+
# torch ๋ Dockerfile ์์ CPU ์ ์ฉ wheel(2.9.0+cpu)๋ก ๋จผ์ ์ค์น๋จ. ์ฌ๊ธฐ ์ ์ธ์
|
| 8 |
+
# ๋ฒ์ ๊ณ ์ ์ฉ์ด๋ฉฐ CPU wheel ์ด ์ด๋ฅผ ์ถฉ์กฑํ๋ฏ๋ก ์ฌ์ค์น๋์ง ์๋๋ค(GPU ๋
ธ๋์์๋ ๋ฌด์).
|
| 9 |
torch==2.9.0
|
| 10 |
|
| 11 |
# Web server
|