mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-01 18:51:14 +06:00
correct resume training steps number in progress bar (#25691)
feat: correct update resume update with steps
This commit is contained in:
parent
6add3b313d
commit
656e17f6f7
@ -598,8 +598,8 @@ def main():
|
|||||||
# need to multiply `gradient_accumulation_steps` to reflect real steps
|
# need to multiply `gradient_accumulation_steps` to reflect real steps
|
||||||
resume_step = int(training_difference.replace("step_", "")) * args.gradient_accumulation_steps
|
resume_step = int(training_difference.replace("step_", "")) * args.gradient_accumulation_steps
|
||||||
starting_epoch = resume_step // len(train_dataloader)
|
starting_epoch = resume_step // len(train_dataloader)
|
||||||
resume_step -= starting_epoch * len(train_dataloader)
|
|
||||||
completed_steps = resume_step // args.gradient_accumulation_steps
|
completed_steps = resume_step // args.gradient_accumulation_steps
|
||||||
|
resume_step -= starting_epoch * len(train_dataloader)
|
||||||
|
|
||||||
# update the progress_bar if load from checkpoint
|
# update the progress_bar if load from checkpoint
|
||||||
progress_bar.update(completed_steps)
|
progress_bar.update(completed_steps)
|
||||||
|
Loading…
Reference in New Issue
Block a user