Skip to content

Commit f5f5e58

Browse files
committed
wip: fix typing dump_checkpoint
1 parent 46cc788 commit f5f5e58

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def _restore_modules_and_callbacks(
412412
self.restore_datamodule()
413413
self.restore_callbacks()
414414

415-
def dump_checkpoint(self, weights_only: bool = False) -> dict:
415+
def dump_checkpoint(self, weights_only: Optional[bool] = None) -> dict:
416416
"""Creating a model checkpoint dictionary object from various component states.
417417
418418
Args:
@@ -450,6 +450,10 @@ def dump_checkpoint(self, weights_only: bool = False) -> dict:
450450
"loops": self._get_loops_state_dict(),
451451
}
452452

453+
if weights_only is None:
454+
weights_only = False
455+
log.info("`weights_only` was not set, defaulting to `False`.")
456+
453457
if not weights_only:
454458
# dump callbacks
455459
checkpoint["callbacks"] = call._call_callbacks_state_dict(trainer)

0 commit comments

Comments
 (0)