Skip to content

Commit 5e40cf4

Browse files
committed
Do not resize if in_sum is null
1 parent adbff66 commit 5e40cf4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/imatrix/imatrix.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,9 @@ bool IMatrixCollector::load_imatrix(const char * file_name) {
938938
int64_t nval = ggml_nelements(in_sum2);
939939
if (e.values.empty()) {
940940
e.values.resize(nval, 0.0f);
941-
e.in_sum.resize(nval, 0.0f);
941+
if (in_sum != nullptr) {
942+
e.in_sum.resize(nval, 0.0f);
943+
}
942944
} else if ((size_t) nval != e.values.size()) {
943945
LOG_ERR("%s: mismatched sums size for %s: %zu != %zu\n", __func__, name.c_str(), (size_t) nval, e.values.size());
944946
gguf_free(ctx_gguf);

0 commit comments

Comments
 (0)