Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +24 -24
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 |
-
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 |
-
#
|
|
|
|
|
|
|
|
|
|
| 17 |
RUN useradd -m -u 1000 user
|
| 18 |
|
| 19 |
# Switch to the "user"
|
|
@@ -39,8 +39,8 @@ 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
|
|
@@ -49,22 +49,22 @@ RUN pip install torch==2.0.0+cu117 torchvision==0.15.0+cu117 -f https://download
|
|
| 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 |
-
|
| 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 |
+
# Install Git and system libraries required for OpenGL without interactive prompts
|
| 8 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 9 |
|
| 10 |
+
# Install Git, OpenGL libraries, and libglib2.0
|
| 11 |
+
RUN apt-get update && apt-get install -y git libgl1-mesa-glx libglib2.0-0
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
+
# Install Ninja and other build tools
|
| 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 |
# Set the working directory to the user's home directory
|
| 40 |
WORKDIR $HOME/app
|
| 41 |
|
| 42 |
+
# Clone your repository or add your code to the container
|
| 43 |
+
RUN git clone -b main https://github.com/ashpexx/make-vid-talk $HOME/app
|
| 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
|
|
|
|
| 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 |
+
RUN 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 |
+
RUN 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 |
+
RUN 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 |
+
RUN 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 |
+
RUN 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 |
+
RUN 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 |
+
RUN 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 |
+
RUN 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 |
+
RUN 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 |
+
RUN 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 |
+
RUN 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 |
+
RUN 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
|
| 70 |
+
CMD ["python", "app.py"]
|