harden: load training-dataset shards with weights_only=True (#14543)
LoadTrainingDataset was the only torch.load call in the codebase without weights_only=True; comfy/utils.py and comfy/sd1_clip.py already pass it. Recent PyTorch defaults to weights_only=True, so this is defense-in-depth for installs pinned to older PyTorch. Verified a typical shard (latents + standard conditioning) round-trips cleanly under weights_only=True.
This commit is contained in:
parent
16514da2e7
commit
94ee49b161
|
|
@ -1583,7 +1583,7 @@ class LoadTrainingDataset(io.ComfyNode):
|
|||
shard_path = os.path.join(dataset_dir, shard_file)
|
||||
|
||||
with open(shard_path, "rb") as f:
|
||||
shard_data = torch.load(f)
|
||||
shard_data = torch.load(f, weights_only=True)
|
||||
|
||||
all_latents.extend(shard_data["latents"])
|
||||
all_conditioning.extend(shard_data["conditioning"])
|
||||
|
|
|
|||
Loading…
Reference in New Issue