Skip to content

Commit

Permalink
examples : fix memory leak on failure to load gpt2 model (ggerganov#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
asmaloney authored Dec 23, 2022
1 parent dc90efd commit 331c0bb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/talk/gpt-2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 331c0bb

Please sign in to comment.