From 70a27aad8bb9f8e19c0be434831fbfb899d541b6 Mon Sep 17 00:00:00 2001 From: ryan-the-crayon <157742211+ryan-the-crayon@users.noreply.github.com> Date: Fri, 21 Jun 2024 05:13:32 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=BEFix=20chunk=20count=20not=20increme?= =?UTF-8?q?nting=20when=20parsing=20additional=20chunks=20in=20a=20local?= =?UTF-8?q?=20file=20(#767)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When parsing a local GGUF and the metadata section does not fit in the same chunk, the parser would try to load more chunks. However, in the local file implementation range view, the chunk count is not incremented, resulting it not actually loading in more data. --- packages/gguf/src/gguf.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/gguf/src/gguf.ts b/packages/gguf/src/gguf.ts index 67d121adc..4d32567bf 100644 --- a/packages/gguf/src/gguf.ts +++ b/packages/gguf/src/gguf.ts @@ -143,6 +143,7 @@ class RangeViewLocalFile extends RangeView { const range = [this.chunk * HTTP_CHUNK_SIZE, (this.chunk + 1) * HTTP_CHUNK_SIZE - 1]; const buffer = await blob.slice(range[0], range[1]).arrayBuffer(); this.appendBuffer(new Uint8Array(buffer)); + this.chunk += 1; } }