Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +38 -45
Dockerfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
FROM pytorch/pytorch:2.1.0-
|
2 |
|
3 |
ENV DEBIAN_FRONTEND=noninteractive
|
4 |
ENV MKL_THREADING_LAYER=GNU
|
@@ -6,74 +6,67 @@ ENV MKL_THREADING_LAYER=GNU
|
|
6 |
# Install dependencies
|
7 |
RUN apt-get update && apt-get install -y \
|
8 |
git wget libgl1-mesa-glx libglib2.0-0 ffmpeg libx264-dev pkg-config \
|
9 |
-
build-essential cmake g++ software-properties-common \
|
10 |
-
gnupg2 libopenblas-dev
|
11 |
rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
# Add NVIDIA package repositories
|
14 |
-
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/
|
15 |
-
dpkg -i cuda-keyring_1.
|
16 |
apt-get update
|
17 |
|
18 |
-
# Install CUDA Toolkit and cuDNN
|
19 |
-
RUN apt-get install -y cuda-toolkit-
|
20 |
|
21 |
-
# Create user
|
22 |
RUN useradd -m -u 1000 user
|
|
|
23 |
|
24 |
-
# Set
|
25 |
ENV HOME=/home/user \
|
26 |
PATH=/home/user/.local/bin:/usr/local/cuda/bin:$PATH \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \
|
28 |
CUDA_HOME=/usr/local/cuda \
|
29 |
LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH \
|
30 |
-
|
31 |
-
TORCH_CUDA_ARCH_LIST="7.0;7.5;8.0;8.6;8.9;9.0"
|
32 |
|
33 |
-
#
|
34 |
-
|
35 |
-
chown -R user:user /home/user
|
36 |
|
37 |
-
#
|
38 |
-
|
39 |
-
chown -R user:user /home/user/app
|
40 |
|
41 |
-
#
|
42 |
-
RUN
|
43 |
-
wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/checkpoints/renderer.pt -O /home/user/app/checkpoints/renderer.pt && \
|
44 |
-
chown -R user:user /home/user/app/checkpoints
|
45 |
|
46 |
-
#
|
47 |
-
|
48 |
-
|
49 |
|
50 |
# Upgrade pip & install dependencies
|
51 |
RUN pip install --upgrade pip setuptools wheel
|
52 |
-
RUN pip install --no-cache-dir urllib3 transformers yacs scipy scikit-image scikit-learn PyYAML Pillow "numpy<2" opencv-python imageio ffmpeg-python av "moviepy<2" gradio
|
53 |
|
54 |
-
#
|
55 |
-
|
56 |
-
DLIB_JPEG_SUPPORT=1 \
|
57 |
-
DLIB_PNG_SUPPORT=1 \
|
58 |
-
PYTHONPATH=$HOME/app \
|
59 |
-
PYTHONUNBUFFERED=1 \
|
60 |
-
GRADIO_ALLOW_FLAGGING=never \
|
61 |
-
GRADIO_NUM_PORTS=1 \
|
62 |
-
GRADIO_SERVER_NAME=0.0.0.0 \
|
63 |
-
GRADIO_THEME=huggingface \
|
64 |
-
GRADIO_SHARE=False \
|
65 |
-
SYSTEM=spaces \
|
66 |
-
CUDA_DEVICE_ORDER=PCI_BUS_ID \
|
67 |
-
CUDA_VISIBLE_DEVICES=0
|
68 |
|
69 |
-
# Install dlib with CUDA support
|
70 |
-
RUN pip install --no-cache-dir dlib
|
71 |
|
72 |
-
#
|
73 |
-
|
74 |
|
75 |
-
#
|
76 |
-
|
|
|
77 |
|
78 |
# Run the application
|
79 |
CMD ["python", "app.py"]
|
|
|
1 |
+
FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime
|
2 |
|
3 |
ENV DEBIAN_FRONTEND=noninteractive
|
4 |
ENV MKL_THREADING_LAYER=GNU
|
|
|
6 |
# Install dependencies
|
7 |
RUN apt-get update && apt-get install -y \
|
8 |
git wget libgl1-mesa-glx libglib2.0-0 ffmpeg libx264-dev pkg-config \
|
9 |
+
build-essential cmake g++ python3-dev software-properties-common \
|
10 |
+
wget gnupg2 libopenblas-dev && \
|
11 |
rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
# Add NVIDIA package repositories
|
14 |
+
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb && \
|
15 |
+
dpkg -i cuda-keyring_1.0-1_all.deb && \
|
16 |
apt-get update
|
17 |
|
18 |
+
# Install CUDA Toolkit and cuDNN
|
19 |
+
RUN apt-get install -y cuda-toolkit-11-7 libcudnn8 libcudnn8-dev
|
20 |
|
21 |
+
# Create a user
|
22 |
RUN useradd -m -u 1000 user
|
23 |
+
USER user
|
24 |
|
25 |
+
# Set CUDA paths
|
26 |
ENV HOME=/home/user \
|
27 |
PATH=/home/user/.local/bin:/usr/local/cuda/bin:$PATH \
|
28 |
+
PYTHONPATH=$HOME/app \
|
29 |
+
PYTHONUNBUFFERED=1 \
|
30 |
+
GRADIO_ALLOW_FLAGGING=never \
|
31 |
+
GRADIO_NUM_PORTS=1 \
|
32 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
33 |
+
GRADIO_THEME=huggingface \
|
34 |
+
GRADIO_SHARE=False \
|
35 |
+
SYSTEM=spaces \
|
36 |
CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \
|
37 |
CUDA_HOME=/usr/local/cuda \
|
38 |
LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH \
|
39 |
+
TORCH_CUDA_ARCH_LIST="8.6"
|
|
|
40 |
|
41 |
+
# Set CUDA & cuDNN paths
|
42 |
+
ENV CMAKE_PREFIX_PATH="/usr/local/cuda:/usr/lib/x86_64-linux-gnu/"
|
|
|
43 |
|
44 |
+
# Set working directory
|
45 |
+
WORKDIR $HOME/app
|
|
|
46 |
|
47 |
+
# Clone the repository
|
48 |
+
RUN git clone -b dev https://github.com/fffiloni/dreamtalk $HOME/app
|
|
|
|
|
49 |
|
50 |
+
# Download model checkpoints
|
51 |
+
RUN wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/checkpoints/denoising_network.pth -O $HOME/app/checkpoints/denoising_network.pth
|
52 |
+
RUN wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/checkpoints/renderer.pt -O $HOME/app/checkpoints/renderer.pt
|
53 |
|
54 |
# Upgrade pip & install dependencies
|
55 |
RUN pip install --upgrade pip setuptools wheel
|
56 |
+
RUN pip install --no-cache-dir urllib3 transformers yacs scipy scikit-image scikit-learn PyYAML Pillow "numpy<2" opencv-python imageio ffmpeg-python av "moviepy<2" gradio
|
57 |
|
58 |
+
# Install CMake first
|
59 |
+
RUN pip install cmake
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
+
# Install dlib with CUDA support (force source compilation)
|
62 |
+
RUN pip install --no-cache-dir dlib -vvv --no-binary dlib
|
63 |
|
64 |
+
# Copy application file
|
65 |
+
COPY app.py .
|
66 |
|
67 |
+
# Set CUDA environment variables
|
68 |
+
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
69 |
+
ENV CUDA_VISIBLE_DEVICES=0
|
70 |
|
71 |
# Run the application
|
72 |
CMD ["python", "app.py"]
|