]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
gguf-py : use copy-on-write mode for localtensor (#18162)
authorSigbjørn Skjæret <redacted>
Thu, 18 Dec 2025 12:45:38 +0000 (13:45 +0100)
committerGitHub <redacted>
Thu, 18 Dec 2025 12:45:38 +0000 (13:45 +0100)
gguf-py/gguf/utility.py

index 7907e706d5818af0c9b0d58b9e777c55863bd387..4918ae971afb3fa3c8d7835be8cf28dc8f158327 100644 (file)
@@ -288,7 +288,7 @@ class LocalTensor:
     data_range: LocalTensorRange
 
     def mmap_bytes(self) -> np.ndarray:
-        return np.memmap(self.data_range.filename, mode='r', offset=self.data_range.offset, shape=self.data_range.size)
+        return np.memmap(self.data_range.filename, mode='c', offset=self.data_range.offset, shape=self.data_range.size)
 
 
 class SafetensorsLocal: