Skip to content

Commit 7dfdbc5

Browse files
committed
change datatype of on_exception hook from Exception to BaseException in ModelCheckpoint
1 parent fd3de65 commit 7dfdbc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lightning/pytorch/callbacks/model_checkpoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def on_validation_end(self, trainer: "pl.Trainer", pl_module: "pl.LightningModul
342342
self._save_last_checkpoint(trainer, monitor_candidates)
343343

344344
@override
345-
def on_exception(self, trainer: "pl.Trainer", pl_module: "pl.LightningModule", exception: Exception) -> None:
345+
def on_exception(self, trainer: "pl.Trainer", pl_module: "pl.LightningModule", exception: BaseException) -> None:
346346
"""Save a checkpoint when an exception is raised."""
347347
if not self._should_save_on_exception(trainer):
348348
return

0 commit comments

Comments
 (0)