nroggendorff commited on
Commit
e5432d0
·
verified ·
1 Parent(s): 35df8bf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +44 -2
Dockerfile CHANGED
@@ -1,10 +1,36 @@
1
  FROM python:latest
2
 
 
 
 
 
 
 
 
 
 
3
  WORKDIR /app
4
 
5
  COPY . .
6
 
7
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  RUN mkdir /.cache && chmod 777 /.cache
10
 
@@ -12,4 +38,20 @@ RUN mkdir /app/zelda-xl && chmod 777 /app/zelda-xl
12
 
13
  RUN accelerate config default
14
 
15
- CMD ["accelerate", "launch", "train.py", "--mixed_precision=fp16", "--learning_rate=1e-5", "--gradient_checkpointing", "--max_train_steps=360", "--lr_scheduler=constant", "--lr_warmup_steps=0", "--use_ema", "--center_crop", "--random_flip", "--pretrained_model_name_or_path=nroggendorff/animexl", "--dataset_name=nroggendorff/zelda", "--resolution=1024", "--train_batch_size=1", "--output_dir=zelda-xl", "--push_to_hub"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  FROM python:latest
2
 
3
+
4
+ ARG OUTPUT_DIR=zelda-style
5
+ ARG INPUT_DS=nroggendorff/zelda-style
6
+ ARG BASE=nroggendorff/zelda-style-diffusion
7
+
8
+ ENV OUTPUT_DIR=${OUTPUT_DIR} \
9
+ INPUT_DS=${INPUT_DS} \
10
+ BASE=${BASE}
11
+
12
  WORKDIR /app
13
 
14
  COPY . .
15
 
16
+ RUN pip install --no-cache-dir --upgrade pip && \
17
+ pip install --no-cache-dir \
18
+ "git+https://github.com/huggingface/diffusers.git@main#egg=diffusers" \
19
+ transformers \
20
+ accelerate \
21
+ safetensors \
22
+ opencv-python \
23
+ datasets \
24
+ dataclasses \
25
+ scikit-learn \
26
+ huggingface-hub \
27
+ tensorboard \
28
+ peft \
29
+ ftfy \
30
+ jinja2 \
31
+ torchvision \
32
+ torch \
33
+ --extra-index-url https://download.pytorch.org/whl/cu121
34
 
35
  RUN mkdir /.cache && chmod 777 /.cache
36
 
 
38
 
39
  RUN accelerate config default
40
 
41
+ CMD bash -c "accelerate launch train.py \
42
+ --mixed_precision=bf16 \
43
+ --gradient_accumulation_steps=1 \
44
+ --learning_rate=3e-5 \
45
+ --gradient_checkpointing \
46
+ --max_train_steps=3000 \
47
+ --lr_scheduler=cosine_with_restarts \
48
+ --lr_warmup_steps=200 \
49
+ --center_crop \
50
+ --random_flip \
51
+ --pretrained_model_name_or_path=${BASE} \
52
+ --dataset_name=${INPUT_DS} \
53
+ --resolution=1024 \
54
+ --train_batch_size=20 \
55
+ --output_dir=${OUTPUT_DIR} \
56
+ --checkpointing_steps=100000 \
57
+ --push_to_hub"