Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +21 -15
Dockerfile
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
# ==== GPU base (CUDA 12.1 + cuDNN) ====
|
2 |
-
|
3 |
-
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
|
4 |
|
5 |
ENV DEBIAN_FRONTEND=noninteractive \
|
6 |
PYTHONDONTWRITEBYTECODE=1 \
|
@@ -10,33 +9,33 @@ ENV DEBIAN_FRONTEND=noninteractive \
|
|
10 |
TRANSFORMERS_CACHE=/root/.cache/huggingface/transformers \
|
11 |
GRADIO_SERVER_NAME=0.0.0.0 \
|
12 |
GRADIO_SERVER_PORT=8080 \
|
13 |
-
DISPLAY=:99
|
14 |
-
CUDA_HOME=/usr/local/cuda
|
15 |
|
16 |
-
# ---- System deps (ffmpeg + headless GL/X)
|
17 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
18 |
-
python3 python3-pip python3-venv
|
19 |
git git-lfs \
|
20 |
ffmpeg \
|
21 |
-
libgl1
|
22 |
-
|
|
|
|
|
23 |
&& git lfs install \
|
24 |
&& rm -rf /var/lib/apt/lists/*
|
25 |
|
|
|
26 |
WORKDIR /app
|
27 |
COPY requirements.txt /app/requirements.txt
|
28 |
|
29 |
-
# ---- Python deps (
|
30 |
-
# Note: we install 'ninja' (Python) too because PyTorch/DS use it for JIT builds.
|
31 |
RUN python3 -m pip install --upgrade pip \
|
32 |
&& python3 -m pip install --extra-index-url https://download.pytorch.org/whl/cu121 \
|
33 |
torch torchvision torchaudio \
|
34 |
-
&& python3 -m pip install
|
35 |
-
&& DS_BUILD_AIO=0 DS_BUILD_SPARSE_ATTN=0 TORCH_CUDA_ARCH_LIST="7.5;8.0;8.6;8.9;9.0" \
|
36 |
-
python3 -m pip install -r requirements.txt \
|
37 |
&& python3 -m pip install huggingface_hub imageio-ffmpeg
|
38 |
|
39 |
# ---- App code ----
|
|
|
40 |
COPY . /app
|
41 |
|
42 |
# ---- Ports & default envs ----
|
@@ -50,5 +49,12 @@ ENV DEVICE=cuda \
|
|
50 |
DEPTH_MODEL_PATH=pretrained/Metric3D/metric_depth_vit_large_800k.pth \
|
51 |
CAPTION_MODEL_PATH=pretrained/Qwen2.5-VL-7B-Instruct
|
52 |
|
53 |
-
#
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# ==== GPU base (CUDA 12.1 + cuDNN) ====
|
2 |
+
FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
|
|
|
3 |
|
4 |
ENV DEBIAN_FRONTEND=noninteractive \
|
5 |
PYTHONDONTWRITEBYTECODE=1 \
|
|
|
9 |
TRANSFORMERS_CACHE=/root/.cache/huggingface/transformers \
|
10 |
GRADIO_SERVER_NAME=0.0.0.0 \
|
11 |
GRADIO_SERVER_PORT=8080 \
|
12 |
+
DISPLAY=:99
|
|
|
13 |
|
14 |
+
# ---- System deps (ffmpeg + headless GL/X) ----
|
15 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
16 |
+
python3 python3-pip python3-venv \
|
17 |
git git-lfs \
|
18 |
ffmpeg \
|
19 |
+
libgl1 \
|
20 |
+
libgl1-mesa-dri \
|
21 |
+
libglib2.0-0 \
|
22 |
+
xvfb \
|
23 |
&& git lfs install \
|
24 |
&& rm -rf /var/lib/apt/lists/*
|
25 |
|
26 |
+
# ---- Workdir & copy requirements first (cache-friendly) ----
|
27 |
WORKDIR /app
|
28 |
COPY requirements.txt /app/requirements.txt
|
29 |
|
30 |
+
# ---- Python deps (Torch CUDA 12.1 first) ----
|
|
|
31 |
RUN python3 -m pip install --upgrade pip \
|
32 |
&& python3 -m pip install --extra-index-url https://download.pytorch.org/whl/cu121 \
|
33 |
torch torchvision torchaudio \
|
34 |
+
&& python3 -m pip install -r requirements.txt \
|
|
|
|
|
35 |
&& python3 -m pip install huggingface_hub imageio-ffmpeg
|
36 |
|
37 |
# ---- App code ----
|
38 |
+
# Expect: gradio_app.py (updated), image_to_video.py, demo/, etc.
|
39 |
COPY . /app
|
40 |
|
41 |
# ---- Ports & default envs ----
|
|
|
49 |
DEPTH_MODEL_PATH=pretrained/Metric3D/metric_depth_vit_large_800k.pth \
|
50 |
CAPTION_MODEL_PATH=pretrained/Qwen2.5-VL-7B-Instruct
|
51 |
|
52 |
+
# Optional (set at runtime to auto-download via gradio_app.py):
|
53 |
+
# ENV REPO_COGVIDEOX=THUDM/CogVideoX1.5-5B-I2V
|
54 |
+
# ENV REPO_METRIC3D=JUGGHM/Metric3D
|
55 |
+
# ENV REPO_QWEN_VL=Qwen/Qwen2.5-VL-7B-Instruct
|
56 |
+
# ENV REPO_REALCAM=MuteApo/RealCam-I2V
|
57 |
+
# ENV HF_TOKEN= # pass at runtime; don't bake secrets
|
58 |
+
|
59 |
+
# (Option A) simplest possible
|
60 |
+
CMD ["python", "finetune/gradio_app.py"]
|