Jaiwincr7 commited on
Commit
e3b077d
·
1 Parent(s): 43dce44

FINAL FIX: Separated torch installation from accelerate/transformers to use correct PyPI index

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -6
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # Use a Debian-based Python image. This is robust for complex scientific libraries.
2
  FROM python:3.10
3
 
4
  # Set the working directory
@@ -18,16 +18,17 @@ COPY app.py .
18
  # 1. Upgrade pip for stability
19
  RUN pip install --upgrade pip
20
 
21
- # 2. Install complex, device-dependent packages explicitly for CPU.
22
- # This ensures that PyTorch, Accelerate, and core Hugging Face libraries
23
- # are correctly linked and installed before other dependencies.
 
 
24
  RUN pip install \
25
- torch --index-url https://download.pytorch.org/whl/cpu \
26
  accelerate \
27
  transformers \
28
  huggingface-hub
29
 
30
- # 3. Install the remaining dependencies from the trimmed requirements.txt
31
  RUN pip install -r requirements.txt
32
 
33
  # --- END INSTALLATION ---
 
1
+ # Use a Debian-based Python image.
2
  FROM python:3.10
3
 
4
  # Set the working directory
 
18
  # 1. Upgrade pip for stability
19
  RUN pip install --upgrade pip
20
 
21
+ # 2. Install PyTorch ONLY, using the CPU-specific index.
22
+ RUN pip install torch --index-url https://download.pytorch.org/whl/cpu
23
+
24
+ # 3. Install all remaining complex and general dependencies using the standard index (PyPI).
25
+ # We install these explicitly here since they were previously excluded from requirements.txt
26
  RUN pip install \
 
27
  accelerate \
28
  transformers \
29
  huggingface-hub
30
 
31
+ # 4. Install the final, smaller dependencies from the trimmed requirements.txt
32
  RUN pip install -r requirements.txt
33
 
34
  # --- END INSTALLATION ---