forked from extern/whisper.cpp
* fix: free ggml_context * ggml : free the model's contexts in whisper_free() Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
This commit is contained in:
parent
e70e5c8b53
commit
2ba66360c9
@ -2169,6 +2169,12 @@ struct whisper_context * whisper_init(const char * path_model) {
|
||||
|
||||
void whisper_free(struct whisper_context * ctx) {
|
||||
if (ctx) {
|
||||
if (ctx->model.ctx) {
|
||||
ggml_free(ctx->model.ctx);
|
||||
}
|
||||
if (ctx->model.ctx_mem) {
|
||||
ggml_free(ctx->model.ctx_mem);
|
||||
}
|
||||
if (ctx->buf_model) {
|
||||
delete ctx->buf_model;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user