Spaces:
Running
Running
Jaiwincr7
commited on
Commit
·
e3b077d
1
Parent(s):
43dce44
FINAL FIX: Separated torch installation from accelerate/transformers to use correct PyPI index
Browse files- Dockerfile +7 -6
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# Use a Debian-based Python image.
|
| 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
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
| 24 |
RUN pip install \
|
| 25 |
-
torch --index-url https://download.pytorch.org/whl/cpu \
|
| 26 |
accelerate \
|
| 27 |
transformers \
|
| 28 |
huggingface-hub
|
| 29 |
|
| 30 |
-
#
|
| 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 ---
|