Make not to save state when args.save_state is False

This commit is contained in:
Yuta Hayashibe
2023-01-18 01:31:38 +09:00
parent 3815b82bef
commit 3eb8fb1875

View File

@@ -1348,7 +1348,7 @@ def save_sd_model_on_epoch_end(args: argparse.Namespace, accelerator, src_path:
remove_old_func = remove_du remove_old_func = remove_du
saving = save_on_epoch_end(args, save_func, remove_old_func, epoch_no, num_train_epochs) saving = save_on_epoch_end(args, save_func, remove_old_func, epoch_no, num_train_epochs)
if saving and args.save_state or args.save_last_n_epochs_state is not None: if saving and args.save_state:
save_state_on_epoch_end(args, accelerator, model_name, epoch_no) save_state_on_epoch_end(args, accelerator, model_name, epoch_no)