Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ShashankMosaicML committed May 23, 2024
1 parent 5660b33 commit 838d16c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llmfoundry/callbacks/loss_perp_v_len_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def batch_end(self, state: State, logger: Logger) -> None:
for k, v in current_metric_dict.items():
v = v.tolist()
v.append(
state.timestamp.batch.value,
state.timestamp.batch.value -
1, # state.timestamp.batch.value - 1 because batch is incremented before batch_end (https://github.com/mosaicml/composer/blob/57c7b72b9df41b0c9777bad1c2bec17f3103c31f/composer/trainer/trainer.py#L2478C1-L2484C55)
) # Add the current batch index as the last column
if k not in self.metric_dict:
self.metric_dict[k] = []
Expand Down

0 comments on commit 838d16c

Please sign in to comment.