diff --git a/src/llama_engine.cc b/src/llama_engine.cc index 18f7cb29..fa9d455b 100644 --- a/src/llama_engine.cc +++ b/src/llama_engine.cc @@ -125,7 +125,13 @@ LlamaEngine::LlamaEngine() { log_disable(); } -LlamaEngine::~LlamaEngine() {} +LlamaEngine::~LlamaEngine() { + for(auto& [_, si]: server_map_) { + auto& l = si.ctx; + l.ReleaseResources(); + } + server_map_.clear(); +} void LlamaEngine::HandleChatCompletion( std::shared_ptr json_body,