llmodel: add model wrapper destructor, fix mem leak in golang bindings (#862)

Signed-off-by: Juuso Alasuutari <juuso.alasuutari@gmail.com>
This commit is contained in:
Juuso Alasuutari
2023-06-12 19:41:22 +03:00
committed by GitHub
parent ae4a275bcd
commit 5cfb1bda89
2 changed files with 12 additions and 10 deletions

View File

@@ -25,6 +25,7 @@ void* load_model(const char *fname, int n_threads) {
return nullptr;
}
if (!llmodel_loadModel(model, fname)) {
llmodel_model_destroy(model);
return nullptr;
}