Do not resize if in_sum is null

This commit is contained in:
Ed Addario 2025-08-05 00:18:53 +01:00
parent adbff66394
commit 5e40cf4f1c
No known key found for this signature in database
GPG Key ID: E7875815A3230993
1 changed files with 3 additions and 1 deletions

View File

@ -938,7 +938,9 @@ bool IMatrixCollector::load_imatrix(const char * file_name) {
int64_t nval = ggml_nelements(in_sum2);
if (e.values.empty()) {
e.values.resize(nval, 0.0f);
e.in_sum.resize(nval, 0.0f);
if (in_sum != nullptr) {
e.in_sum.resize(nval, 0.0f);
}
} else if ((size_t) nval != e.values.size()) {
LOG_ERR("%s: mismatched sums size for %s: %zu != %zu\n", __func__, name.c_str(), (size_t) nval, e.values.size());
gguf_free(ctx_gguf);