Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +25 -25
Dockerfile
CHANGED
@@ -4,16 +4,16 @@ FROM pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel
|
|
4 |
# Add NVIDIA CUDA GPG key
|
5 |
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key A4B469963BF863CC
|
6 |
|
7 |
-
#
|
8 |
ENV DEBIAN_FRONTEND=noninteractive
|
9 |
|
10 |
-
# Install
|
11 |
-
RUN apt-get update &&
|
|
|
|
|
|
|
12 |
|
13 |
-
#
|
14 |
-
RUN apt-get update && apt-get install -y ninja-build unzip ffmpeg cmake g++ build-essential aria2
|
15 |
-
|
16 |
-
# Set up a new user named "user" with user ID 1000
|
17 |
RUN useradd -m -u 1000 user
|
18 |
|
19 |
# Switch to the "user"
|
@@ -39,32 +39,32 @@ ENV HOME=/home/user \
|
|
39 |
# Set the working directory to the user's home directory
|
40 |
WORKDIR $HOME/app
|
41 |
|
42 |
-
#
|
43 |
-
|
44 |
|
45 |
# Install specific versions of PyTorch and TorchVision
|
46 |
RUN pip install torch==2.0.0+cu117 torchvision==0.15.0+cu117 -f https://download.pytorch.org/whl/torch_stable.html
|
47 |
|
48 |
# Install dependencies including Gunicorn
|
49 |
-
RUN pip install --no-cache-dir -r requirements.txt gradio==4.36.1 moviepy
|
50 |
|
51 |
# Download checkpoint files using aria2
|
52 |
-
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/30_net_gen.pth -d $HOME/app/checkpoints -o 30_net_gen.pth
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
|
66 |
# Ensure the compiled CUDA code can be found
|
67 |
ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
|
68 |
|
69 |
-
# Set the entrypoint to Gunicorn
|
70 |
-
CMD ["
|
|
|
4 |
# Add NVIDIA CUDA GPG key
|
5 |
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key A4B469963BF863CC
|
6 |
|
7 |
+
# Set environment variable to avoid interactive prompts
|
8 |
ENV DEBIAN_FRONTEND=noninteractive
|
9 |
|
10 |
+
# Install system libraries and tools
|
11 |
+
RUN apt-get update && \
|
12 |
+
apt-get install -y git libgl1-mesa-glx libglib2.0-0 ninja-build unzip ffmpeg cmake g++ build-essential aria2 && \
|
13 |
+
apt-get clean && \
|
14 |
+
rm -rf /var/lib/apt/lists/*
|
15 |
|
16 |
+
# Set up a new user named "user"
|
|
|
|
|
|
|
17 |
RUN useradd -m -u 1000 user
|
18 |
|
19 |
# Switch to the "user"
|
|
|
39 |
# Set the working directory to the user's home directory
|
40 |
WORKDIR $HOME/app
|
41 |
|
42 |
+
# Copy your code and dependencies
|
43 |
+
COPY . .
|
44 |
|
45 |
# Install specific versions of PyTorch and TorchVision
|
46 |
RUN pip install torch==2.0.0+cu117 torchvision==0.15.0+cu117 -f https://download.pytorch.org/whl/torch_stable.html
|
47 |
|
48 |
# Install dependencies including Gunicorn
|
49 |
+
RUN pip install --no-cache-dir -r requirements.txt gradio==4.36.1 moviepy gunicorn
|
50 |
|
51 |
# Download checkpoint files using aria2
|
52 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/30_net_gen.pth -d $HOME/app/checkpoints -o 30_net_gen.pth && \
|
53 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/BFM.zip -d $HOME/app/checkpoints -o BFM.zip && \
|
54 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/DNet.pt -d $HOME/app/checkpoints -o DNet.pt && \
|
55 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/ENet.pth -d $HOME/app/checkpoints -o ENet.pth && \
|
56 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/GFPGANv1.3.pth -d $HOME/app/checkpoints -o GFPGANv1.3.pth && \
|
57 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/GPEN-BFR-512.pth -d $HOME/app/checkpoints -o GPEN-BFR-512.pth && \
|
58 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/LNet.pth -d $HOME/app/checkpoints -o LNet.pth && \
|
59 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/ParseNet-latest.pth -d $HOME/app/checkpoints -o ParseNet-latest.pth && \
|
60 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/RetinaFace-R50.pth -d $HOME/app/checkpoints -o RetinaFace-R50.pth && \
|
61 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/expression.mat -d $HOME/app/checkpoints -o expression.mat && \
|
62 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/face3d_pretrain_epoch_20.pth -d $HOME/app/checkpoints -o face3d_pretrain_epoch_20.pth && \
|
63 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/shape_predictor_68_face_landmarks.dat -d $HOME/app/checkpoints -o shape_predictor_68_face_landmarks.dat && \
|
64 |
+
unzip -d $HOME/app/checkpoints/BFM $HOME/app/checkpoints/BFM.zip
|
65 |
|
66 |
# Ensure the compiled CUDA code can be found
|
67 |
ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
|
68 |
|
69 |
+
# Set the entrypoint to Gunicorn if that's your WSGI server
|
70 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "app:app"]
|