From: Yuri Khrustalev Date: Wed, 17 Dec 2025 01:27:03 +0000 (-0500) Subject: gguf-py : allow converting multi-tensor models from read-only locations (#18100) X-Git-Tag: upstream/0.0.7446~3 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=2973a65ecb6c884ca609de6eb5f1b6dc08631aaf;p=pkg%2Fggml%2Fsources%2Fllama.cpp gguf-py : allow converting multi-tensor models from read-only locations (#18100) --- diff --git a/gguf-py/gguf/utility.py b/gguf-py/gguf/utility.py index c9401a1c..7907e706 100644 --- a/gguf-py/gguf/utility.py +++ b/gguf-py/gguf/utility.py @@ -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: