commit
fe792d62b1
3 changed files with 9 additions and 2 deletions
|
@ -150,6 +150,7 @@ bool load_hparams_and_tensors_from_gguf(const std::string &fname, NexaBaseModel
|
||||||
}
|
}
|
||||||
|
|
||||||
ggml_free(meta);
|
ggml_free(meta);
|
||||||
|
gguf_free(ctx_gguf);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -314,4 +315,4 @@ struct ggml_tensor * ggml_graph_node(struct ggml_cgraph * cgraph, int i) {
|
||||||
|
|
||||||
GGML_ASSERT(i < cgraph->n_nodes);
|
GGML_ASSERT(i < cgraph->n_nodes);
|
||||||
return cgraph->nodes[i];
|
return cgraph->nodes[i];
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
//
|
//
|
||||||
// Constants
|
// Constants
|
||||||
|
@ -708,6 +709,7 @@ void omni_free(struct omni_context *ctx_omni)
|
||||||
if(internal_chars != nullptr)
|
if(internal_chars != nullptr)
|
||||||
{
|
{
|
||||||
free(internal_chars);
|
free(internal_chars);
|
||||||
|
internal_chars = nullptr;
|
||||||
}
|
}
|
||||||
if (ctx_omni->ctx_whisper)
|
if (ctx_omni->ctx_whisper)
|
||||||
{
|
{
|
||||||
|
@ -716,12 +718,13 @@ void omni_free(struct omni_context *ctx_omni)
|
||||||
}
|
}
|
||||||
if (ctx_omni->projector)
|
if (ctx_omni->projector)
|
||||||
{
|
{
|
||||||
ctx_omni->projector->free();
|
delete ctx_omni->projector;
|
||||||
}
|
}
|
||||||
|
|
||||||
llama_free(ctx_omni->ctx_llama);
|
llama_free(ctx_omni->ctx_llama);
|
||||||
llama_free_model(ctx_omni->model);
|
llama_free_model(ctx_omni->model);
|
||||||
llama_backend_free();
|
llama_backend_free();
|
||||||
|
free(ctx_omni);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool omni_eval_audio_embed(llama_context *ctx_llama, ggml_tensor *audio_embed, int n_batch, int *n_past)
|
static bool omni_eval_audio_embed(llama_context *ctx_llama, ggml_tensor *audio_embed, int n_batch, int *n_past)
|
||||||
|
@ -761,6 +764,7 @@ static bool omni_eval_audio_embed(llama_context *ctx_llama, ggml_tensor *audio_e
|
||||||
}
|
}
|
||||||
*n_past += n_eval;
|
*n_past += n_eval;
|
||||||
}
|
}
|
||||||
|
free(audio_embed_data);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9467,6 +9467,8 @@ static bool whisper_encoder_load(struct whisper_model_loader *loader, whisper_co
|
||||||
|
|
||||||
wctx.t_load_us = ggml_time_us() - t_start_us;
|
wctx.t_load_us = ggml_time_us() - t_start_us;
|
||||||
|
|
||||||
|
gguf_free(gguf_ctx);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue