free old ctx on retry
This commit is contained in:
parent
a696b0a16c
commit
0aa3d839fb
1 changed files with 1 additions and 0 deletions
|
@ -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)) {
|
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",
|
fprintf(stderr, "%s: tensor '%s' has wrong size in model file: got %zu, expected %zu\n",
|
||||||
__func__, name.data(), ggml_nbytes(tensor), nelements*bpe);
|
__func__, name.data(), ggml_nbytes(tensor), nelements*bpe);
|
||||||
|
ggml_free(ctx);
|
||||||
return ModelLoadResult::RETRY_LOAD;
|
return ModelLoadResult::RETRY_LOAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue