]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
gguf-py : allow converting multi-tensor models from read-only locations (#18100)
authorYuri Khrustalev <redacted>
Wed, 17 Dec 2025 01:27:03 +0000 (20:27 -0500)
committerGitHub <redacted>
Wed, 17 Dec 2025 01:27:03 +0000 (02:27 +0100)
gguf-py/gguf/utility.py

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