fix: use copy-on-write mmap mode to silence non-writable tensor warning

This commit is contained in:
2026-07-22 17:37:41 +08:00
parent ef8783b7e3
commit 4eeb23e2b3
+1 -1
View File
@@ -100,7 +100,7 @@ def load_bin(file_path: str) -> Dict[str, List[Tensor]]:
arr = np.memmap( arr = np.memmap(
os.path.join(file_path, f"{key}.bin"), os.path.join(file_path, f"{key}.bin"),
dtype=info["dtype"], dtype=info["dtype"],
mode="r", mode="c",
shape=tuple(info["shape"]), shape=tuple(info["shape"]),
) )
segments[key] = [torch.from_numpy(arr)] segments[key] = [torch.from_numpy(arr)]