We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 794d05b commit 2b5da3bCopy full SHA for 2b5da3b
comfy/utils.py
@@ -32,6 +32,7 @@
32
import json
33
import time
34
import mmap
35
+import warnings
36
37
MMAP_TORCH_FILES = args.mmap_torch_files
38
DISABLE_MMAP = args.disable_mmap
@@ -85,7 +86,10 @@ def load_safetensors(ckpt):
85
86
header_size = struct.unpack("<Q", mapping[:8])[0]
87
header = json.loads(mapping[8:8+header_size].decode("utf-8"))
88
- data_area = torch.frombuffer(mapping, dtype=torch.uint8)[8 + header_size:]
89
+ with warnings.catch_warnings():
90
+ #We are working with read-only RAM by design
91
+ warnings.filterwarnings("ignore", message="The given buffer is not writable")
92
+ data_area = torch.frombuffer(mapping, dtype=torch.uint8)[8 + header_size:]
93
94
sd = {}
95
for name, info in header.items():
0 commit comments