mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-02-28 22:51:45 +00:00
Add warning when using old pytorch versions.
This commit is contained in:
parent
7fc3ccdcc2
commit
2f3ab40b62
@ -43,7 +43,8 @@ if hasattr(torch.serialization, "add_safe_globals"): # TODO: this was added in
|
|||||||
torch.serialization.add_safe_globals([ModelCheckpoint, scalar, dtype, Float64DType, encode])
|
torch.serialization.add_safe_globals([ModelCheckpoint, scalar, dtype, Float64DType, encode])
|
||||||
ALWAYS_SAFE_LOAD = True
|
ALWAYS_SAFE_LOAD = True
|
||||||
logging.info("Checkpoint files will always be loaded safely.")
|
logging.info("Checkpoint files will always be loaded safely.")
|
||||||
|
else:
|
||||||
|
logging.info("Warning, you are using an old pytorch version and some ckpt/pt files might be loaded unsafely. Upgrading to 2.4 or above is recommended.")
|
||||||
|
|
||||||
def load_torch_file(ckpt, safe_load=False, device=None):
|
def load_torch_file(ckpt, safe_load=False, device=None):
|
||||||
if device is None:
|
if device is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user