Create Dockerfile
Browse files- Dockerfile +84 -0
Dockerfile
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
|
2 |
+
|
3 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
4 |
+
|
5 |
+
# Set the MKL_THREADING_LAYER environment variable to GNU
|
6 |
+
ENV MKL_THREADING_LAYER=GNU
|
7 |
+
|
8 |
+
# Install Git, OpenGL libraries, and libglib2.0
|
9 |
+
RUN apt-get update && apt-get install -y git libgl1-mesa-glx libglib2.0-0
|
10 |
+
|
11 |
+
RUN apt-get update && apt-get install -y ninja-build
|
12 |
+
|
13 |
+
# Install necessary dependencies, including CMake, a C++ compiler, and others
|
14 |
+
RUN apt-get update && apt-get install -y unzip ffmpeg cmake g++ build-essential espeak-ng 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" user
|
20 |
+
USER user
|
21 |
+
|
22 |
+
# Set environment variables
|
23 |
+
ENV HOME=/home/user \
|
24 |
+
CUDA_HOME=/usr/local/cuda \
|
25 |
+
PATH=/home/user/.local/bin:$PATH \
|
26 |
+
LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH} \
|
27 |
+
LIBRARY_PATH=${CUDA_HOME}/lib64/stubs:${LIBRARY_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 |
+
|
37 |
+
# Set the working directory to the user's home directory
|
38 |
+
WORKDIR $HOME/app
|
39 |
+
|
40 |
+
# Clone your repository or add your code to the container
|
41 |
+
RUN git clone -b main https://github.com/Blizaine/AniPortrait $HOME/app
|
42 |
+
|
43 |
+
# Install dependencies
|
44 |
+
#COPY requirements.txt $HOME/app/requirements.txt
|
45 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
46 |
+
|
47 |
+
# Download checkpoint files using aria2
|
48 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/AniPortrait/resolve/main/audio2mesh.pt -d $HOME/app/pretrained_model -o audio2mesh.pt
|
49 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/AniPortrait/resolve/main/denoising_unet.pth -d $HOME/app/pretrained_model -o denoising_unet.pth
|
50 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/AniPortrait/resolve/main/motion_module.pth -d $HOME/app/pretrained_model -o motion_module.pth
|
51 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/AniPortrait/resolve/main/pose_guider.pth -d $HOME/app/pretrained_model -o pose_guider.pth
|
52 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/AniPortrait/resolve/main/reference_unet.pth -d $HOME/app/pretrained_model -o reference_unet.pth
|
53 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/champ/denoising_unet.pth -d $HOME/app/pretrained_model -o denoising_unet.pth
|
54 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/champ/guidance_encoder_depth.pth -d $HOME/app/pretrained_model -o guidance_encoder_depth.pth
|
55 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/champ/guidance_encoder_dwpose.pth -d $HOME/app/pretrained_model -o guidance_encoder_dwpose.pth
|
56 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/champ/guidance_encoder_normal.pth -d $HOME/app/pretrained_model -o guidance_encoder_normal.pth
|
57 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/champ/guidance_encoder_semantic_map.pth -d $HOME/app/pretrained_model -o guidance_encoder_semantic_map.pth
|
58 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/champ/motion_module.pth -d $HOME/app/pretrained_model -o motion_module.pth
|
59 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/champ/reference_unet.pth -d $HOME/app/pretrained_model -o reference_unet.pth
|
60 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/raw/main/image_encoder/config.json -d $HOME/app/pretrained_model/image_encoder -o config.json
|
61 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/image_encoder/pytorch_model.bin -d $HOME/app/pretrained_model/image_encoder -o pytorch_model.bin
|
62 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/raw/main/sd-vae-ft-mse/config.json -d $HOME/app/pretrained_model/sd-vae-ft-mse -o config.json
|
63 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/sd-vae-ft-mse/diffusion_pytorch_model.bin -d $HOME/app/pretrained_model/sd-vae-ft-mse -o diffusion_pytorch_model.bin
|
64 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/raw/main/stable-diffusion-v1-5/feature_extractor/preprocessor_config.json -d $HOME/app/pretrained_model/stable-diffusion-v1-5/feature_extractor -o preprocessor_config.json
|
65 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/raw/main/stable-diffusion-v1-5/model_index.json -d $HOME/app/pretrained_model/stable-diffusion-v1-5 -o model_index.json
|
66 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/raw/main/stable-diffusion-v1-5/unet/config.json -d $HOME/app/pretrained_model/stable-diffusion-v1-5/unet -o config.json
|
67 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/stable-diffusion-v1-5/unet/diffusion_pytorch_model.bin -d $HOME/app/pretrained_model/stable-diffusion-v1-5/unet -o diffusion_pytorch_model.bin
|
68 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/raw/main/stable-diffusion-v1-5/v1-inference.yaml -d $HOME/app/pretrained_model/stable-diffusion-v1-5 -o v1-inference.yaml
|
69 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/facebook/wav2vec2-base-960h/raw/main/config.json -d $HOME/app/pretrained_model/wav2vec2-base-960h -o config.json
|
70 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/facebook/wav2vec2-base-960h/raw/main/feature_extractor_config.json -d $HOME/app/pretrained_model/wav2vec2-base-960h -o feature_extractor_config.json
|
71 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/facebook/wav2vec2-base-960h/raw/main/preprocessor_config.json -d $HOME/app/pretrained_model/wav2vec2-base-960h -o preprocessor_config.json
|
72 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/facebook/wav2vec2-base-960h/resolve/main/pytorch_model.bin -d $HOME/app/pretrained_model/wav2vec2-base-960h -o pytorch_model.bin
|
73 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/facebook/wav2vec2-base-960h/raw/main/special_tokens_map.json -d $HOME/app/pretrained_model/wav2vec2-base-960h -o special_tokens_map.json
|
74 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/facebook/wav2vec2-base-960h/resolve/main/tf_model.h5 -d $HOME/app/pretrained_model/wav2vec2-base-960h -o tf_model.h5
|
75 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/facebook/wav2vec2-base-960h/raw/main/tokenizer_config.json -d $HOME/app/pretrained_model/wav2vec2-base-960h -o tokenizer_config.json
|
76 |
+
RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/facebook/wav2vec2-base-960h/raw/main/vocab.json -d $HOME/app/pretrained_model/wav2vec2-base-960h -o vocab.json
|
77 |
+
|
78 |
+
|
79 |
+
# Set the environment variable to specify the GPU device
|
80 |
+
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
81 |
+
ENV CUDA_VISIBLE_DEVICES=0
|
82 |
+
|
83 |
+
# Run your app.py script
|
84 |
+
CMD ["python", "app.py"]
|