Unverified Commit 20528f06 authored by Teddy Ferdinan's avatar Teddy Ferdinan Committed by GitHub
Browse files

Cast epochs_trained to int when resuming training (#32286)



* fix epochs_trained as int when resuming training

* refactor

---------
Co-authored-by: default avatarteddyferdinan <teddy.ferdinan@pwr.edu.pl>
parent 934fe150
......@@ -2155,7 +2155,7 @@ class Trainer:
self.state = TrainerState.load_from_json(os.path.join(resume_from_checkpoint, TRAINER_STATE_NAME))
self.compare_trainer_and_checkpoint_args(self.args, self.state)
self._load_callback_state()
epochs_trained = self.state.global_step // num_update_steps_per_epoch
epochs_trained = int(self.state.global_step // num_update_steps_per_epoch)
if not args.ignore_data_skip:
steps_trained_in_current_epoch = self.state.global_step % (num_update_steps_per_epoch)
steps_trained_in_current_epoch *= args.gradient_accumulation_steps
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment