Spaces:
Configuration error
Configuration error
update training code
Browse files
app.py
CHANGED
@@ -61,11 +61,11 @@ 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
|
65 |
--pretrained_model_name_or_path={MODEL_NAME} \
|
66 |
--instance_data_dir={INSTANCE_DIR} \
|
67 |
--output_dir={OUTPUT_DIR} \
|
68 |
-
--instance_prompt=
|
69 |
--train_text_encoder \
|
70 |
--resolution=512 \
|
71 |
--train_batch_size=1 \
|
@@ -73,9 +73,9 @@ def accelerate_train_lora(steps, images, in_prompt):
|
|
73 |
--learning_rate=1e-4 \
|
74 |
--learning_rate_text=5e-5 \
|
75 |
--color_jitter \
|
76 |
-
--lr_scheduler=
|
77 |
--lr_warmup_steps=0 \
|
78 |
-
--max_train_steps={int(steps)}
|
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'} \
|
65 |
--pretrained_model_name_or_path={MODEL_NAME} \
|
66 |
--instance_data_dir={INSTANCE_DIR} \
|
67 |
--output_dir={OUTPUT_DIR} \
|
68 |
+
--instance_prompt='{in_prompt}' \
|
69 |
--train_text_encoder \
|
70 |
--resolution=512 \
|
71 |
--train_batch_size=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"
|