Skip to content

Commit

Permalink
Update lighter/system.py
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
surajpaib and coderabbitai[bot] authored May 20, 2024
1 parent 2ee64c9 commit 9c2d300
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lighter/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def _base_step(self, batch: Dict, batch_idx: int, mode: str) -> Union[Dict[str,

# If the loss is a dict, the sublosses must be combined under "total" key.
if isinstance(loss, dict) and "total" not in loss:
raise ValueError("The loss dictionary must have 'total' loss, combining all the sublosses.")
raise ValueError("The loss dictionary must include a 'total' key that combines all sublosses. Example: {'total': combined_loss, 'subloss1': loss1, ...}")

# Logging
self._log_stats(loss, metrics, mode, batch_idx)
Expand Down

0 comments on commit 9c2d300

Please sign in to comment.