fix: don't save state if no --save-state arg given

This commit is contained in:
Evgeny Chukreev
2023-05-18 20:09:06 +02:00
parent c924c47f37
commit 0c942106bf

View File

@@ -3167,6 +3167,7 @@ def save_sd_model_on_epoch_end_or_stepwise(
print(f"removing old model: {remove_out_dir}") print(f"removing old model: {remove_out_dir}")
shutil.rmtree(remove_out_dir) shutil.rmtree(remove_out_dir)
if args.save_state:
if on_epoch_end: if on_epoch_end:
save_and_remove_state_on_epoch_end(args, accelerator, epoch_no) save_and_remove_state_on_epoch_end(args, accelerator, epoch_no)
else: else: