Add simple one character fix so that on_step_begin and on_step_end are called at the right times (#10839)

This commit is contained in:
Sidd Karamcheti 2021-03-22 06:15:39 -07:00 committed by GitHub
parent 24ab5b08a3
commit b230181d41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1067,7 +1067,7 @@ class Trainer:
steps_trained_in_current_epoch -= 1
continue
if (step + 1) % self.args.gradient_accumulation_steps == 0:
if step % self.args.gradient_accumulation_steps == 0:
self.control = self.callback_handler.on_step_begin(self.args, self.state, self.control)
if (