Skip to content

Commit 394c42a

Browse files
authored
Fix callback call in Fabric Trainer example (#19986)
1 parent c1af4d0 commit 394c42a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/fabric/build_your_own_trainer/trainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def train_loop(
227227
should_optim_step = self.global_step % self.grad_accum_steps == 0
228228
if should_optim_step:
229229
# currently only supports a single optimizer
230-
self.fabric.call("on_before_optimizer_step", optimizer, 0)
230+
self.fabric.call("on_before_optimizer_step", optimizer)
231231

232232
# optimizer step runs train step internally through closure
233233
optimizer.step(partial(self.training_step, model=model, batch=batch, batch_idx=batch_idx))

0 commit comments

Comments
 (0)