Skip to content

Commit 28fee97

Browse files
committed
ggml_row_size accounting fix for GGUF v14
Credits : @ikawrakow
1 parent 7c3833b commit 28fee97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ggml/src/gguf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ struct gguf_context * gguf_init_from_file_impl(FILE * file, struct gguf_init_par
632632

633633
// calculate byte offsets given the tensor shape and type
634634
info.t.nb[0] = type_size;
635-
info.t.nb[1] = info.t.nb[0]*(info.t.ne[0]/blck_size);
635+
info.t.nb[1] = ggml_row_size(info.t.type, info.t.ne[0]);
636636
for (int j = 2; j < GGML_MAX_DIMS; ++j) {
637637
info.t.nb[j] = info.t.nb[j - 1]*info.t.ne[j - 1];
638638
}

0 commit comments

Comments
 (0)