Skip to content

Commit 2973a65

Browse files
authored
gguf-py : allow converting multi-tensor models from read-only locations (#18100)
1 parent d0794e8 commit 2973a65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gguf-py/gguf/utility.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ class LocalTensor:
288288
data_range: LocalTensorRange
289289

290290
def mmap_bytes(self) -> np.ndarray:
291-
return np.memmap(self.data_range.filename, offset=self.data_range.offset, shape=self.data_range.size)
291+
return np.memmap(self.data_range.filename, mode='r', offset=self.data_range.offset, shape=self.data_range.size)
292292

293293

294294
class SafetensorsLocal:

0 commit comments

Comments
 (0)