From 0aa3d839fbf6b32cbe52e7483388803084ccc403 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Tue, 25 Apr 2023 23:42:57 +0800 Subject: [PATCH] free old ctx on retry --- otherarch/neox.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/otherarch/neox.cpp b/otherarch/neox.cpp index 9e264faae..519bc34a7 100644 --- a/otherarch/neox.cpp +++ b/otherarch/neox.cpp @@ -318,6 +318,7 @@ ModelLoadResult stablelm_model_load(const std::string & fname, stablelm_model & if ((nelements*bpe)/ggml_blck_size(tensor->type) != ggml_nbytes(tensor)) { fprintf(stderr, "%s: tensor '%s' has wrong size in model file: got %zu, expected %zu\n", __func__, name.data(), ggml_nbytes(tensor), nelements*bpe); + ggml_free(ctx); return ModelLoadResult::RETRY_LOAD; }