Skip to content

Commit 0c17cd7

Browse files
committed
typing
1 parent e90ae44 commit 0c17cd7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lightning/pytorch/trainer/connectors/callback_connector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def _configure_checkpoint_callbacks(self, enable_checkpointing: bool) -> None:
9595
elif enable_checkpointing:
9696
if module_available("litmodels") and self.trainer._model_registry:
9797
trainer_source = inspect.getmodule(self.trainer)
98-
if trainer_source is None:
98+
if trainer_source is None or not isinstance(trainer_source.__package__, str):
9999
raise RuntimeError("Unable to determine the source of the trainer.")
100100
# this need to imported based on the actual package lightning/pytorch_lightning
101101
if "pytorch_lightning" in trainer_source.__package__:

0 commit comments

Comments
 (0)