From 1dc02150bc56f195dea6b722b02ae507390a4628 Mon Sep 17 00:00:00 2001 From: isotr0py <2037008807@qq.com> Date: Mon, 4 Nov 2024 16:44:17 +0800 Subject: [PATCH] optimize offsets calculation --- gguf-py/gguf/gguf_reader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gguf-py/gguf/gguf_reader.py b/gguf-py/gguf/gguf_reader.py index fb51756da..754cb501c 100644 --- a/gguf-py/gguf/gguf_reader.py +++ b/gguf-py/gguf/gguf_reader.py @@ -203,9 +203,9 @@ class GGUFReader: # Handle arrays. if gtype == GGUFValueType.ARRAY: raw_itype = self._get(offs, np.uint32) - offs += int(raw_itype.nbytes) + offs = self.data.tell() alen = self._get(offs, np.uint64) - offs += int(alen.nbytes) + offs = self.data.tell() aparts: list[npt.NDArray[Any]] = [raw_itype, alen] data_idxs: list[int] = [] for idx in range(alen[0]):