chanmin0723 Claude Opus 4.8 commited on
Commit
4879fbd
ยท
1 Parent(s): 519d26c

Install CPU-only torch to fix HF cpu-basic startup stall

Browse files

Default 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>

Files changed (2) hide show
  1. Dockerfile +4 -0
  2. 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