Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch when accelerate command is not found #2477

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion kohya_gui/dreambooth_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,12 @@ def train_model(
log.info(max_train_steps_info)
log.info(f"lr_warmup_steps = {lr_warmup_steps}")

run_cmd = [rf'{get_executable_path("accelerate")}', "launch"]
accelerate_path = get_executable_path("accelerate")
if accelerate_path == "":
log.error("accelerate not found")
return TRAIN_BUTTON_VISIBLE

run_cmd = [rf'{accelerate_path}', "launch"]

run_cmd = AccelerateLaunch.run_cmd(
run_cmd=run_cmd,
Expand Down
7 changes: 6 additions & 1 deletion kohya_gui/finetune_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,12 @@ def train_model(
lr_warmup_steps = 0
log.info(f"lr_warmup_steps = {lr_warmup_steps}")

run_cmd = [rf'{get_executable_path("accelerate")}', "launch"]
accelerate_path = get_executable_path("accelerate")
if accelerate_path == "":
log.error("accelerate not found")
return TRAIN_BUTTON_VISIBLE

run_cmd = [rf'{accelerate_path}', "launch"]

run_cmd = AccelerateLaunch.run_cmd(
run_cmd=run_cmd,
Expand Down
7 changes: 6 additions & 1 deletion kohya_gui/lora_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,12 @@ def train_model(
log.info(f"stop_text_encoder_training = {stop_text_encoder_training}")
log.info(f"lr_warmup_steps = {lr_warmup_steps}")

run_cmd = [rf'{get_executable_path("accelerate")}', "launch"]
accelerate_path = get_executable_path("accelerate")
if accelerate_path == "":
log.error("accelerate not found")
return TRAIN_BUTTON_VISIBLE

run_cmd = [rf'{accelerate_path}', "launch"]

run_cmd = AccelerateLaunch.run_cmd(
run_cmd=run_cmd,
Expand Down
7 changes: 6 additions & 1 deletion kohya_gui/textual_inversion_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,12 @@ def train_model(
log.info(f"stop_text_encoder_training = {stop_text_encoder_training}")
log.info(f"lr_warmup_steps = {lr_warmup_steps}")

run_cmd = [rf'{get_executable_path("accelerate")}', "launch"]
accelerate_path = get_executable_path("accelerate")
if accelerate_path == "":
log.error("accelerate not found")
return TRAIN_BUTTON_VISIBLE

run_cmd = [rf'{accelerate_path}', "launch"]

run_cmd = AccelerateLaunch.run_cmd(
run_cmd=run_cmd,
Expand Down
Loading