Skip to content

Commit

Permalink
correct resume training steps number in progress bar (huggingface#25691)
Browse files Browse the repository at this point in the history
feat: correct update resume update with steps
  • Loading branch information
pphuc25 authored Aug 23, 2023
1 parent 6add3b3 commit 656e17f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/pytorch/language-modeling/run_clm_no_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,8 @@ def group_texts(examples):
# need to multiply `gradient_accumulation_steps` to reflect real steps
resume_step = int(training_difference.replace("step_", "")) * args.gradient_accumulation_steps
starting_epoch = resume_step // len(train_dataloader)
resume_step -= starting_epoch * len(train_dataloader)
completed_steps = resume_step // args.gradient_accumulation_steps
resume_step -= starting_epoch * len(train_dataloader)

# update the progress_bar if load from checkpoint
progress_bar.update(completed_steps)
Expand Down

0 comments on commit 656e17f

Please sign in to comment.