Skip to content

Commit 70a27aa

Browse files
👾Fix chunk count not incrementing when parsing additional chunks in a local file (#767)
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.
1 parent e2689f8 commit 70a27aa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎packages/gguf/src/gguf.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ class RangeViewLocalFile extends RangeView {
143143
const range = [this.chunk * HTTP_CHUNK_SIZE, (this.chunk + 1) * HTTP_CHUNK_SIZE - 1];
144144
const buffer = await blob.slice(range[0], range[1]).arrayBuffer();
145145
this.appendBuffer(new Uint8Array(buffer));
146+
this.chunk += 1;
146147
}
147148
}
148149

0 commit comments

Comments
 (0)