mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-27 03:44:35 +00:00
gguf-py : numpy 2 newbyteorder fix (#9772)
This commit is contained in:
parent
9f35e44592
commit
4601a8bb67
@ -145,11 +145,10 @@ class GGUFReader:
|
|||||||
count = int(count)
|
count = int(count)
|
||||||
itemsize = int(np.empty([], dtype = dtype).itemsize)
|
itemsize = int(np.empty([], dtype = dtype).itemsize)
|
||||||
end_offs = offset + itemsize * count
|
end_offs = offset + itemsize * count
|
||||||
return (
|
arr = self.data[offset:end_offs].view(dtype=dtype)[:count]
|
||||||
self.data[offset:end_offs]
|
if override_order is None:
|
||||||
.view(dtype = dtype)[:count]
|
return arr
|
||||||
.newbyteorder(override_order or self.byte_order)
|
return arr.view(arr.dtype.newbyteorder(override_order))
|
||||||
)
|
|
||||||
|
|
||||||
def _push_field(self, field: ReaderField, skip_sum: bool = False) -> int:
|
def _push_field(self, field: ReaderField, skip_sum: bool = False) -> int:
|
||||||
if field.name in self.fields:
|
if field.name in self.fields:
|
||||||
|
Loading…
Reference in New Issue
Block a user