Skip to content

Commit 4d65777

Browse files
committed
add weights_only arg
1 parent 6b711c9 commit 4d65777

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lightning/fabric/strategies/strategy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ def load_checkpoint(
310310
path: _PATH,
311311
state: Optional[Union[Module, Optimizer, dict[str, Union[Module, Optimizer, Any]]]] = None,
312312
strict: bool = True,
313+
weights_only: bool = False,
313314
) -> dict[str, Any]:
314315
"""Load the contents from a checkpoint and restore the state of the given objects.
315316
@@ -330,7 +331,7 @@ def load_checkpoint(
330331
331332
"""
332333
torch.cuda.empty_cache()
333-
checkpoint = self.checkpoint_io.load_checkpoint(path)
334+
checkpoint = self.checkpoint_io.load_checkpoint(path, weights_only)
334335
if not state:
335336
return checkpoint
336337

0 commit comments

Comments
 (0)