Spaces:
Running
Running
Manually install Torch CPU in Dockerfile to bypass pip resolution issues
Browse files- Dockerfile +3 -2
- requirements.txt +0 -3
Dockerfile
CHANGED
|
@@ -2,10 +2,11 @@ FROM python:3.10
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# The full python:3.10 image usually has all required system libraries for OpenCV.
|
| 6 |
-
# We also update and install ffmpeg and libgl1 just to be absolutely sure.
|
| 7 |
RUN apt-get update && apt-get install -y ffmpeg libgl1 libglib2.0-0 && rm -rf /var/lib/apt/lists/*
|
| 8 |
|
|
|
|
|
|
|
|
|
|
| 9 |
COPY requirements.txt .
|
| 10 |
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y ffmpeg libgl1 libglib2.0-0 && rm -rf /var/lib/apt/lists/*
|
| 6 |
|
| 7 |
+
# Force install PyTorch CPU wheels explicitly before other requirements
|
| 8 |
+
RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu
|
| 9 |
+
|
| 10 |
COPY requirements.txt .
|
| 11 |
|
| 12 |
RUN pip install --no-cache-dir -r requirements.txt
|
requirements.txt
CHANGED
|
@@ -1,10 +1,7 @@
|
|
| 1 |
-
--extra-index-url https://download.pytorch.org/whl/cpu
|
| 2 |
fastapi
|
| 3 |
uvicorn
|
| 4 |
python-multipart
|
| 5 |
Pillow
|
| 6 |
-
torch
|
| 7 |
-
torchvision
|
| 8 |
transformers
|
| 9 |
opencv-python-headless
|
| 10 |
gfpgan
|
|
|
|
|
|
|
| 1 |
fastapi
|
| 2 |
uvicorn
|
| 3 |
python-multipart
|
| 4 |
Pillow
|
|
|
|
|
|
|
| 5 |
transformers
|
| 6 |
opencv-python-headless
|
| 7 |
gfpgan
|