Răsfoiți Sursa

gguf-py : allow converting multi-tensor models from read-only locations (#18100)

Yuri Khrustalev 1 lună în urmă
părinte
comite
2973a65ecb
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      gguf-py/gguf/utility.py

+ 1 - 1
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: