From 0f61e8ce9868a76ad23bd705edd0a2be4c906638 Mon Sep 17 00:00:00 2001 From: greeshmay Date: Wed, 16 Nov 2022 13:49:03 -0800 Subject: [PATCH] fix: free ggml_context --- whisper.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/whisper.cpp b/whisper.cpp index d894f69..646b032 100644 --- a/whisper.cpp +++ b/whisper.cpp @@ -930,6 +930,7 @@ static bool whisper_model_load(const std::string & fname, whisper_context & wctx model.tensors["decoder.blocks." + std::to_string(i) + ".cross_attn.out.bias"] = layer.cross_attn_ln_1_b; } } + ggml_free(ctx); } // create the ggml memory context @@ -981,6 +982,7 @@ static bool whisper_model_load(const std::string & fname, whisper_context & wctx ggml_nbytes(model.memory_cross_k) + ggml_nbytes(model.memory_cross_v); fprintf(stderr, "%s: memory size = %8.2f MB\n", __func__, memory_size/1024.0/1024.0); + ggml_free(ctx); } // load weights