Jacky2305 commited on
Commit
b4680c2
·
1 Parent(s): 85aea48

Use pytorch/pytorch:2.4.1-cpu base image to avoid torch install

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -49
  2. requirements.txt +16 -7
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,55 +14,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
14
 
15
  WORKDIR /app
16
 
17
- # Install Python dependencies in batches to avoid memory issues
18
  COPY requirements.txt .
19
-
20
- # Batch 1: Core ML deps (torch already has index-url)
21
- RUN pip install --no-cache-dir --timeout=300 \
22
- torch==2.4.1+cpu torchaudio==2.4.1+cpu \
23
- --index-url https://download.pytorch.org/whl/cpu
24
-
25
- # Batch 2: Audio processing
26
- RUN pip install --no-cache-dir --timeout=300 \
27
- numpy>=1.24.0,<2 \
28
- scipy>=1.10.0,<2 \
29
- librosa>=0.10.0,<0.11 \
30
- soundfile>=0.12.0,<1 \
31
- ffmpeg-python>=0.2.0,<1 \
32
- av>=15.1.0,<16
33
-
34
- # Batch 3: ML utilities
35
- RUN pip install --no-cache-dir --timeout=300 \
36
- faiss-cpu>=1.13.0,<2 \
37
- praat-parselmouth>=0.4.5,<1 \
38
- transformers>=4.49.0,<4.50 \
39
- onnxruntime>=1.24.4,<2 \
40
- opencv-python-headless>=4.10.0,<5 \
41
- scikit-learn>=1.6.0,<2 \
42
- einops>=0.8.0,<1
43
-
44
- # Batch 4: Web UI
45
- RUN pip install --no-cache-dir --timeout=300 \
46
- gradio>=4.44.0 \
47
- fastapi>=0.88.0,<0.100 \
48
- uvicorn>=0.20.0,<0.23 \
49
- pydantic>=1.10.13,<2 \
50
- httpx>=0.23.0,<0.24 \
51
- anyio>=3.6.2,<4 \
52
- starlette>=0.22.0,<0.28 \
53
- websockets>=10.4,<11
54
-
55
- # Batch 5: Remaining
56
- RUN pip install --no-cache-dir --timeout=300 \
57
- tqdm>=4.67.0,<5 \
58
- huggingface_hub>=0.20.0 \
59
- PyYAML>=6.0 \
60
- coloredlogs>=15.0,<16 \
61
- torchfcpe>=0.0.4,<0.1 \
62
- hyper-connections>=0.1.8,<0.4.3 \
63
- local-attention>=1.11.0,<2 \
64
- networkx>=3.2.0,<4 \
65
- matplotlib>=3.8.2,<4
66
 
67
  # Copy RVC source code
68
  COPY infer ./infer
 
1
+ FROM pytorch/pytorch:2.4.1-cpu
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
  ENV PIP_NO_CACHE_DIR=1
 
14
 
15
  WORKDIR /app
16
 
17
+ # Install remaining Python dependencies (torch/torchaudio already in base)
18
  COPY requirements.txt .
19
+ RUN pip install --no-cache-dir --timeout=300 -r requirements.txt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  # Copy RVC source code
22
  COPY infer ./infer
requirements.txt CHANGED
@@ -1,9 +1,4 @@
1
- # Runtime dependencies for RVC inference
2
- torch==2.4.1+cpu
3
- torchaudio==2.4.1+cpu
4
- --index-url https://download.pytorch.org/whl/cpu
5
-
6
- gradio>=4.44.0
7
  numpy>=1.24.0,<2
8
  scipy>=1.10.0,<2
9
  librosa>=0.10.0,<0.11
@@ -21,4 +16,18 @@ opencv-python-headless>=4.10.0,<5
21
  scikit-learn>=1.6.0,<2
22
  PyYAML>=6.0
23
  coloredlogs>=15.0,<16
24
- torchfcpe>=0.0.4,<0.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Runtime dependencies for RVC inference (torch/torchaudio in base image)
 
 
 
 
 
2
  numpy>=1.24.0,<2
3
  scipy>=1.10.0,<2
4
  librosa>=0.10.0,<0.11
 
16
  scikit-learn>=1.6.0,<2
17
  PyYAML>=6.0
18
  coloredlogs>=15.0,<16
19
+ torchfcpe>=0.0.4,<0.1
20
+ hyper-connections>=0.1.8,<0.4.3
21
+ local-attention>=1.11.0,<2
22
+ networkx>=3.2.0,<4
23
+ matplotlib>=3.8.2,<4
24
+
25
+ # Gradio & web deps
26
+ gradio>=4.44.0
27
+ fastapi>=0.88.0,<0.100
28
+ uvicorn>=0.20.0,<0.23
29
+ pydantic>=1.10.13,<2
30
+ httpx>=0.23.0,<0.24
31
+ anyio>=3.6.2,<4
32
+ starlette>=0.22.0,<0.28
33
+ websockets>=10.4,<11