Skip to content

Commit 54b859a

Browse files
committed
default to weights_only=true for loading from state_dict from url
1 parent 2c2ab9e commit 54b859a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lightning/fabric/utilities/cloud_io.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ def _load(
5656
weights_only=weights_only,
5757
)
5858
if str(path_or_url).startswith("http"):
59+
if weights_only is None:
60+
weights_only = True
61+
log.debug(f"Default to `weights_only=True` for remote checkpoint: {path_or_url}")
5962
return torch.hub.load_state_dict_from_url(
6063
str(path_or_url),
6164
map_location=map_location, # type: ignore[arg-type]

0 commit comments

Comments
 (0)