File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
src/lightning/fabric/utilities Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 26
26
from fsspec .implementations .local import AbstractFileSystem
27
27
from lightning_utilities .core .imports import module_available
28
28
29
- from lightning .fabric .utilities .imports import _TORCH_GREATER_EQUAL_2_6
30
29
from lightning .fabric .utilities .types import _MAP_LOCATION_TYPE , _PATH
31
30
32
31
log = logging .getLogger (__name__ )
@@ -58,12 +57,11 @@ def _load(
58
57
)
59
58
if str (path_or_url ).startswith ("http" ):
60
59
if weights_only is None :
61
- if _TORCH_GREATER_EQUAL_2_6 :
62
- weights_only = True
63
- log .debug (f"Default to `weights_only=True` for remote checkpoint for torch>=2.6: { path_or_url } " )
64
- else :
65
- weights_only = False
66
- log .debug (f"Default to `weights_only=False` for remote checkpoint for torch<2.6: { path_or_url } " )
60
+ weights_only = False
61
+ log .debug (
62
+ f"Defaulting to `weights_only=False` for remote checkpoint: { path_or_url } ."
63
+ f" If loading a checkpoint from an untrustted source, we recommend using `weights_only=True`."
64
+ )
67
65
68
66
return torch .hub .load_state_dict_from_url (
69
67
str (path_or_url ),
You can’t perform that action at this time.
0 commit comments