ysharma HF staff commited on
Commit
cda4f79
·
1 Parent(s): b159029

update acelerate launch scripts

Browse files
Files changed (1) hide show
  1. app.py +1 -15
app.py CHANGED
@@ -61,21 +61,7 @@ def accelerate_train_lora(steps, images, in_prompt):
61
  os.makedirs(INSTANCE_DIR, exist_ok=True)
62
  shutil.copy( file.name, INSTANCE_DIR) #/{file.orig_name}
63
  #subprocess.Popen(f'accelerate launch {"./train_lora_dreambooth.py"} \
64
- os.system( f"accelerate launch {'./train_lora_dreambooth.py'} \
65
- --pretrained_model_name_or_path={MODEL_NAME} \
66
- --instance_data_dir={INSTANCE_DIR} \
67
- --output_dir={OUTPUT_DIR} \
68
- --instance_prompt='disney baby lion' \
69
- --train_text_encoder \
70
- --resolution=512 \
71
- --train_batch_size=1 \
72
- --gradient_accumulation_steps=1 \
73
- --learning_rate='1e-4' \
74
- --learning_rate_text='5e-5' \
75
- --color_jitter \
76
- --lr_scheduler='constant' \
77
- --lr_warmup_steps=0 \
78
- --max_train_steps={int(steps)}") #10000
79
  print("*********** completing accelerate_train_lora ***********")
80
  print(f"files in output_dir -- {os.listdir(OUTPUT_DIR)}")
81
  #lora_trained_weights = "./output_example/lora_weight.pt"
 
61
  os.makedirs(INSTANCE_DIR, exist_ok=True)
62
  shutil.copy( file.name, INSTANCE_DIR) #/{file.orig_name}
63
  #subprocess.Popen(f'accelerate launch {"./train_lora_dreambooth.py"} \
64
+ os.system( f"accelerate launch {'./train_lora_dreambooth.py'} --pretrained_model_name_or_path={MODEL_NAME} --instance_data_dir={INSTANCE_DIR} --output_dir={OUTPUT_DIR} --instance_prompt='{in_prompt}' --train_text_encoder --resolution=512 --train_batch_size=1 --gradient_accumulation_steps=1 --learning_rate='1e-4' --learning_rate_text='5e-5' --color_jitter --lr_scheduler='constant' --lr_warmup_steps=0 --max_train_steps={int(steps)}") #10000
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  print("*********** completing accelerate_train_lora ***********")
66
  print(f"files in output_dir -- {os.listdir(OUTPUT_DIR)}")
67
  #lora_trained_weights = "./output_example/lora_weight.pt"