Create Dockerfile
Browse files- Dockerfile +45 -0
Dockerfile
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM runpod/pytorch:2.2.1-py3.10-cuda12.1.1-devel-ubuntu22.04
|
2 |
+
WORKDIR /content
|
3 |
+
ENV PATH="/home/camenduru/.local/bin:${PATH}"
|
4 |
+
RUN adduser --disabled-password --gecos '' camenduru && \
|
5 |
+
adduser camenduru sudo && \
|
6 |
+
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
|
7 |
+
chown -R camenduru:camenduru /content && \
|
8 |
+
chmod -R 777 /content && \
|
9 |
+
chown -R camenduru:camenduru /home && \
|
10 |
+
chmod -R 777 /home
|
11 |
+
|
12 |
+
RUN apt update -y && add-apt-repository -y ppa:git-core/ppa && apt update -y && apt install -y aria2 git git-lfs unzip ffmpeg
|
13 |
+
|
14 |
+
USER camenduru
|
15 |
+
|
16 |
+
RUN pip install -q opencv-python imageio imageio-ffmpeg ffmpeg-python av runpod \
|
17 |
+
xformers==0.0.25 diffusers==0.28.2 transformers==4.26.1 accelerate==0.27.2 deepspeed==0.8.1 imageio==2.25.1 numpy==1.21.6 omegaconf==2.3.0 sentencepiece==0.1.99 fire cpm_kernels && \
|
18 |
+
git clone -b dev https://github.com/camenduru/Kolors /content/Kolors && cd /content/Kolors && pip install -e . && \
|
19 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/raw/main/scheduler/scheduler_config.json -d /content/Kolors/weights/Kolors/scheduler -o scheduler_config.json && \
|
20 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/raw/main/text_encoder/config.json -d /content/Kolors/weights/Kolors/text_encoder -o config.json && \
|
21 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/raw/main/text_encoder/configuration_chatglm.py -d /content/Kolors/weights/Kolors/text_encoder -o configuration_chatglm.py && \
|
22 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/raw/main/text_encoder/modeling_chatglm.py -d /content/Kolors/weights/Kolors/text_encoder -o modeling_chatglm.py && \
|
23 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/resolve/main/text_encoder/pytorch_model-00001-of-00007.bin -d /content/Kolors/weights/Kolors/text_encoder -o pytorch_model-00001-of-00007.bin && \
|
24 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/resolve/main/text_encoder/pytorch_model-00002-of-00007.bin -d /content/Kolors/weights/Kolors/text_encoder -o pytorch_model-00002-of-00007.bin && \
|
25 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/resolve/main/text_encoder/pytorch_model-00003-of-00007.bin -d /content/Kolors/weights/Kolors/text_encoder -o pytorch_model-00003-of-00007.bin && \
|
26 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/resolve/main/text_encoder/pytorch_model-00004-of-00007.bin -d /content/Kolors/weights/Kolors/text_encoder -o pytorch_model-00004-of-00007.bin && \
|
27 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/resolve/main/text_encoder/pytorch_model-00005-of-00007.bin -d /content/Kolors/weights/Kolors/text_encoder -o pytorch_model-00005-of-00007.bin && \
|
28 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/resolve/main/text_encoder/pytorch_model-00006-of-00007.bin -d /content/Kolors/weights/Kolors/text_encoder -o pytorch_model-00006-of-00007.bin && \
|
29 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/resolve/main/text_encoder/pytorch_model-00007-of-00007.bin -d /content/Kolors/weights/Kolors/text_encoder -o pytorch_model-00007-of-00007.bin && \
|
30 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/raw/main/text_encoder/pytorch_model.bin.index.json -d /content/Kolors/weights/Kolors/text_encoder -o pytorch_model.bin.index.json && \
|
31 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/raw/main/text_encoder/quantization.py -d /content/Kolors/weights/Kolors/text_encoder -o quantization.py && \
|
32 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/raw/main/text_encoder/tokenization_chatglm.py -d /content/Kolors/weights/Kolors/text_encoder -o tokenization_chatglm.py && \
|
33 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/resolve/main/text_encoder/tokenizer.model -d /content/Kolors/weights/Kolors/text_encoder -o tokenizer.model && \
|
34 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/raw/main/text_encoder/tokenizer_config.json -d /content/Kolors/weights/Kolors/text_encoder -o tokenizer_config.json && \
|
35 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/resolve/main/text_encoder/vocab.txt -d /content/Kolors/weights/Kolors/text_encoder -o vocab.txt && \
|
36 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/raw/main/unet/config.json -d /content/Kolors/weights/Kolors/unet -o config.json && \
|
37 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/resolve/main/unet/diffusion_pytorch_model.safetensors -d /content/Kolors/weights/Kolors/unet -o diffusion_pytorch_model.safetensors && \
|
38 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/resolve/main/unet/diffusion_pytorch_model.fp16.safetensors -d /content/Kolors/weights/Kolors/unet -o diffusion_pytorch_model.fp16.safetensors && \
|
39 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/raw/main/vae/config.json -d /content/Kolors/weights/Kolors/vae -o config.json && \
|
40 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/resolve/main/vae/diffusion_pytorch_model.safetensors -d /content/Kolors/weights/Kolors/vae -o diffusion_pytorch_model.safetensors && \
|
41 |
+
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Kwai-Kolors/Kolors/resolve/main/vae/diffusion_pytorch_model.fp16.safetensors -d /content/Kolors/weights/Kolors/vae -o diffusion_pytorch_model.fp16.safetensors
|
42 |
+
|
43 |
+
COPY ./worker_runpod.py /content/Kolors/worker_runpod.py
|
44 |
+
WORKDIR /content/Kolors
|
45 |
+
CMD python worker_runpod.py
|