camenduru commited on
Commit
5b88ea8
·
verified ·
1 Parent(s): a41e666

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +57 -0
Dockerfile ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ WORKDIR /content
4
+
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+ ENV PYTHONUNBUFFERED=True
7
+ ENV PATH="/home/camenduru/.local/bin:/usr/local/cuda/bin:${PATH}"
8
+
9
+ RUN apt update -y && apt install -y software-properties-common build-essential \
10
+ libgl1 libglib2.0-0 zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev && \
11
+ add-apt-repository -y ppa:git-core/ppa && apt update -y && \
12
+ apt install -y python-is-python3 python3-pip sudo nano aria2 curl wget git git-lfs unzip unrar ffmpeg && \
13
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://developer.download.nvidia.com/compute/cuda/12.6.2/local_installers/cuda_12.6.2_560.35.03_linux.run -d /content -o cuda_12.6.2_560.35.03_linux.run && sh cuda_12.6.2_560.35.03_linux.run --silent --toolkit && \
14
+ echo "/usr/local/cuda/lib64" >> /etc/ld.so.conf && ldconfig && \
15
+ git clone https://github.com/aristocratos/btop /content/btop && cd /content/btop && make && make install && \
16
+ adduser --disabled-password --gecos '' camenduru && \
17
+ adduser camenduru sudo && \
18
+ echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
19
+ chown -R camenduru:camenduru /content && \
20
+ chmod -R 777 /content && \
21
+ chown -R camenduru:camenduru /home && \
22
+ chmod -R 777 /home
23
+
24
+ USER camenduru
25
+
26
+ RUN pip install torch==2.5.1+cu124 torchvision==0.20.1+cu124 torchaudio==2.5.1+cu124 torchtext==0.18.0 torchdata==0.8.0 --extra-index-url https://download.pytorch.org/whl/cu124 && \
27
+ pip install xformers==0.0.28.post3 && \
28
+ pip install opencv-contrib-python imageio imageio-ffmpeg ffmpeg-python av runpod && \
29
+ pip install torchsde einops diffusers transformers accelerate loguru && \
30
+ pip install https://github.com/Dao-AILab/flash-attention/releases/download/v2.6.3/flash_attn-2.6.3+cu123torch2.3cxx11abiFALSE-cp310-cp310-linux_x86_64.whl && \
31
+ git clone https://github.com/Tencent/HunyuanVideo /content/HunyuanVideo && \
32
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/resolve/main/hunyuan-video-t2v-720p/transformers/mp_rank_00_model_states.pt -d /content/HunyuanVideo/ckpts/hunyuan-video-t2v-720p/transformers -o mp_rank_00_model_states.pt && \
33
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/raw/main/hunyuan-video-t2v-720p/vae/config.json -d /content/HunyuanVideo/ckpts/hunyuan-video-t2v-720p/vae -o config.json && \
34
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/resolve/main/hunyuan-video-t2v-720p/vae/pytorch_model.pt -d /content/HunyuanVideo/ckpts/hunyuan-video-t2v-720p/vae -o pytorch_model.pt && \
35
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/raw/main/text_encoder/config.json -d /content/HunyuanVideo/ckpts/text_encoder -o config.json && \
36
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/raw/main/text_encoder/generation_config.json -d /content/HunyuanVideo/ckpts/text_encoder -o generation_config.json && \
37
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/resolve/main/text_encoder/model-00001-of-00004.safetensors -d /content/HunyuanVideo/ckpts/text_encoder -o model-00001-of-00004.safetensors && \
38
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/resolve/main/text_encoder/model-00002-of-00004.safetensors -d /content/HunyuanVideo/ckpts/text_encoder -o model-00002-of-00004.safetensors && \
39
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/resolve/main/text_encoder/model-00003-of-00004.safetensors -d /content/HunyuanVideo/ckpts/text_encoder -o model-00003-of-00004.safetensors && \
40
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/resolve/main/text_encoder/model-00004-of-00004.safetensors -d /content/HunyuanVideo/ckpts/text_encoder -o model-00004-of-00004.safetensors && \
41
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/raw/main/text_encoder/model.safetensors.index.json -d /content/HunyuanVideo/ckpts/text_encoder -o model.safetensors.index.json && \
42
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/raw/main/text_encoder/special_tokens_map.json -d /content/HunyuanVideo/ckpts/text_encoder -o special_tokens_map.json && \
43
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/resolve/main/text_encoder/tokenizer.json -d /content/HunyuanVideo/ckpts/text_encoder -o tokenizer.json && \
44
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/raw/main/text_encoder/tokenizer_config.json -d /content/HunyuanVideo/ckpts/text_encoder -o tokenizer_config.json && \
45
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/raw/main/text_encoder_2/config.json -d /content/HunyuanVideo/ckpts/text_encoder_2 -o config.json && \
46
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/raw/main/text_encoder_2/merges.txt -d /content/HunyuanVideo/ckpts/text_encoder_2 -o merges.txt && \
47
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/resolve/main/text_encoder_2/model.safetensors -d /content/HunyuanVideo/ckpts/text_encoder_2 -o model.safetensors && \
48
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/raw/main/text_encoder_2/preprocessor_config.json -d /content/HunyuanVideo/ckpts/text_encoder_2 -o preprocessor_config.json && \
49
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/resolve/main/text_encoder_2/pytorch_model.bin -d /content/HunyuanVideo/ckpts/text_encoder_2 -o pytorch_model.bin && \
50
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/raw/main/text_encoder_2/special_tokens_map.json -d /content/HunyuanVideo/ckpts/text_encoder_2 -o special_tokens_map.json && \
51
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/raw/main/text_encoder_2/tokenizer.json -d /content/HunyuanVideo/ckpts/text_encoder_2 -o tokenizer.json && \
52
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/raw/main/text_encoder_2/tokenizer_config.json -d /content/HunyuanVideo/ckpts/text_encoder_2 -o tokenizer_config.json && \
53
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/HunyuanVideo/raw/main/text_encoder_2/vocab.json -d /content/HunyuanVideo/ckpts/text_encoder_2 -o vocab.json
54
+
55
+ COPY ./worker_runpod.py /content/HunyuanVideo/worker_runpod.py
56
+ WORKDIR /content/HunyuanVideo
57
+ CMD python worker_runpod.py