Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +20 -8
Dockerfile
CHANGED
|
@@ -7,31 +7,43 @@ WORKDIR /app
|
|
| 7 |
# 3. Copy all your project files (app.py, CatVTON folder, etc.)
|
| 8 |
COPY . .
|
| 9 |
|
| 10 |
-
# 4. Install system dependencies needed for 'av' and 'opencv'
|
| 11 |
# 4. Install system dependencies needed for 'av' and 'opencv'
|
| 12 |
RUN apt-get update && apt-get install -y \
|
| 13 |
ffmpeg \
|
| 14 |
libgl1 \
|
| 15 |
&& apt-get clean
|
| 16 |
|
| 17 |
-
# 5. Run your
|
| 18 |
-
#
|
| 19 |
-
|
|
|
|
| 20 |
RUN --mount=type=cache,target=/root/.cache/pip \
|
| 21 |
pip uninstall -y numpy scipy scikit-learn matplotlib huggingface-hub accelerate peft && \
|
| 22 |
pip install numpy==1.26.4 && \
|
| 23 |
pip install scipy==1.11.4 && \
|
| 24 |
pip install scikit-learn==1.3.2 && \
|
| 25 |
-
pip install matplotlib==3.7.2
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
pip install huggingface_hub==0.20.0 && \
|
| 28 |
pip install safetensors==0.4.1 && \
|
| 29 |
pip install diffusers==0.25.0 && \
|
| 30 |
pip install transformers==4.36.0 && \
|
| 31 |
pip install accelerate==0.28.0 && \
|
| 32 |
-
pip install peft==0.8.2
|
|
|
|
|
|
|
|
|
|
| 33 |
pip install opencv-python-headless==4.8.1.78 pillow==11.3.0 && \
|
| 34 |
-
pip install fvcore==0.1.5.post20221221 iopath==0.1.10 av==16.0.1 omegaconf==2.3.0
|
|
|
|
|
|
|
|
|
|
| 35 |
pip install ipywidgets==8.1.5 && \
|
| 36 |
pip install gradio==4.31.0
|
| 37 |
|
|
|
|
| 7 |
# 3. Copy all your project files (app.py, CatVTON folder, etc.)
|
| 8 |
COPY . .
|
| 9 |
|
|
|
|
| 10 |
# 4. Install system dependencies needed for 'av' and 'opencv'
|
| 11 |
RUN apt-get update && apt-get install -y \
|
| 12 |
ffmpeg \
|
| 13 |
libgl1 \
|
| 14 |
&& apt-get clean
|
| 15 |
|
| 16 |
+
# 5. Run your Kaggle installation script in smaller, logical steps
|
| 17 |
+
# This prevents the "Out of Memory" (Exit 137) error.
|
| 18 |
+
|
| 19 |
+
# --- Step 5a: Uninstall and install core scientific stack
|
| 20 |
RUN --mount=type=cache,target=/root/.cache/pip \
|
| 21 |
pip uninstall -y numpy scipy scikit-learn matplotlib huggingface-hub accelerate peft && \
|
| 22 |
pip install numpy==1.26.4 && \
|
| 23 |
pip install scipy==1.11.4 && \
|
| 24 |
pip install scikit-learn==1.3.2 && \
|
| 25 |
+
pip install matplotlib==3.7.2
|
| 26 |
+
|
| 27 |
+
# --- Step 5b: Install PyTorch stack
|
| 28 |
+
RUN --mount=type=cache,target=/root/.cache/pip \
|
| 29 |
+
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118
|
| 30 |
+
|
| 31 |
+
# --- Step 5c: Install Hugging Face stack
|
| 32 |
+
RUN --mount=type=cache,target=/root/.cache/pip \
|
| 33 |
pip install huggingface_hub==0.20.0 && \
|
| 34 |
pip install safetensors==0.4.1 && \
|
| 35 |
pip install diffusers==0.25.0 && \
|
| 36 |
pip install transformers==4.36.0 && \
|
| 37 |
pip install accelerate==0.28.0 && \
|
| 38 |
+
pip install peft==0.8.2
|
| 39 |
+
|
| 40 |
+
# --- Step 5d: Install Vision/Utility stack
|
| 41 |
+
RUN --mount=type=cache,target=/root/.cache/pip \
|
| 42 |
pip install opencv-python-headless==4.8.1.78 pillow==11.3.0 && \
|
| 43 |
+
pip install fvcore==0.1.5.post20221221 iopath==0.1.10 av==16.0.1 omegaconf==2.3.0
|
| 44 |
+
|
| 45 |
+
# --- Step 5e: Install Gradio stack
|
| 46 |
+
RUN --mount=type=cache,target=/root/.cache/pip \
|
| 47 |
pip install ipywidgets==8.1.5 && \
|
| 48 |
pip install gradio==4.31.0
|
| 49 |
|