1
0
mirror of https://github.com/ggerganov/whisper.cpp.git synced 2025-07-06 01:11:40 +02:00

examples : fix memory leak on failure to load gpt2 model ()

This commit is contained in:
Andy Maloney
2022-12-23 13:19:07 -05:00
committed by GitHub
parent dc90efd504
commit 331c0bbddc

@ -841,6 +841,7 @@ struct gpt2_context * gpt2_init(const char * path_model) {
if (!gpt2_model_load(path_model, ctx->model, ctx->vocab)) {
fprintf(stderr, "%s: failed to load model from '%s'\n", __func__, path_model);
delete ctx;
return nullptr;
}