Skip to content

Commit 919ce6f

Browse files
committed
fix: add custom loop and docs
Signed-off-by: Mehant Kammakomati <mehant.kammakomati2@ibm.com>
1 parent 07b4774 commit 919ce6f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

plugins/online-data-mixing/artifacts/custom_loop_usage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ class State:
9191
accelerator.backward(loss)
9292
optimizer.step()
9393
optimizer.zero_grad()
94-
if step % 1 == 0 and accelerator.is_main_process:
95-
print(f"Step {step} | Loss: {loss.item():.4f}")
94+
if step_idx % 1 == 0 and accelerator.is_main_process:
95+
print(f"Step {step_idx} ||| Loss: {loss.item():.4f}")
9696
state.log_history.append(
9797
{"loss": loss.item() if not torch.isnan(loss) else 1e100}
9898
)

0 commit comments

Comments
 (0)