Merge pull request #348 from ddPn08/dev

Added a function to upload to Huggingface and resume from Huggingface.
This commit is contained in:
Kohya S
2023-04-05 21:47:36 +09:00
committed by GitHub
9 changed files with 188 additions and 17 deletions

View File

@@ -231,9 +231,7 @@ def train(args):
train_util.patch_accelerator_for_fp16_training(accelerator)
# resumeする
if args.resume is not None:
print(f"resume training from state: {args.resume}")
accelerator.load_state(args.resume)
train_util.resume(accelerator, args)
# epoch数を計算する
num_update_steps_per_epoch = math.ceil(len(train_dataloader) / args.gradient_accumulation_steps)