diff --git a/examples/talk/gpt-2.cpp b/examples/talk/gpt-2.cpp index c50157f..c28644d 100644 --- a/examples/talk/gpt-2.cpp +++ b/examples/talk/gpt-2.cpp @@ -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; }