Jacky2305 commited on
Commit
9e02fef
·
1 Parent(s): fb08d5c

Split torch install first to avoid memory peak

Browse files
Files changed (2) hide show
  1. Dockerfile +7 -2
  2. requirements.txt +1 -5
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM python:3.10-slim
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
  ENV PIP_NO_CACHE_DIR=1
@@ -14,7 +14,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
14
 
15
  WORKDIR /app
16
 
17
- # Install minimal Python dependencies in one go
 
 
 
 
 
18
  COPY requirements.txt .
19
  RUN pip install --no-cache-dir --timeout=300 -r requirements.txt
20
 
 
1
+ FROM python:3.11-slim-bookworm
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
  ENV PIP_NO_CACHE_DIR=1
 
14
 
15
  WORKDIR /app
16
 
17
+ # Install torch first (largest package)
18
+ RUN pip install --no-cache-dir --timeout=300 \
19
+ torch==2.4.1+cpu torchaudio==2.4.1+cpu \
20
+ --index-url https://download.pytorch.org/whl/cpu
21
+
22
+ # Install remaining dependencies
23
  COPY requirements.txt .
24
  RUN pip install --no-cache-dir --timeout=300 -r requirements.txt
25
 
requirements.txt CHANGED
@@ -1,8 +1,4 @@
1
- # Minimal RVC inference dependencies
2
- torch==2.4.1+cpu
3
- torchaudio==2.4.1+cpu
4
- --index-url https://download.pytorch.org/whl/cpu
5
-
6
  numpy>=1.24.0,<2
7
  scipy>=1.10.0,<2
8
  librosa>=0.10.0,<0.11
 
1
+ # Minimal RVC inference dependencies (torch/torchaudio installed separately)
 
 
 
 
2
  numpy>=1.24.0,<2
3
  scipy>=1.10.0,<2
4
  librosa>=0.10.0,<0.11