From 557110d0baa29cbc15e44eb816f504767a023e22 Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Sat, 13 Jan 2024 23:36:31 -0500 Subject: [PATCH] Disable `mmap` with lora layers (#1985) --- llm/ext_server/ext_server.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/llm/ext_server/ext_server.cpp b/llm/ext_server/ext_server.cpp index c30d4220..c6ecf719 100644 --- a/llm/ext_server/ext_server.cpp +++ b/llm/ext_server/ext_server.cpp @@ -47,9 +47,13 @@ void llama_server_init(ext_server_params *sparams, ext_server_resp_t *err) { params.model = sparams->model; } - for (ext_server_lora_adapter *la = sparams->lora_adapters; la != NULL; - la = la->next) { - params.lora_adapter.push_back(std::make_tuple(la->adapter, la->scale)); + if (sparams->lora_adapters != NULL) { + for (ext_server_lora_adapter *la = sparams->lora_adapters; la != NULL; + la = la->next) { + params.lora_adapter.push_back(std::make_tuple(la->adapter, la->scale)); + } + + params.use_mmap = false; } if (sparams->mmproj != NULL) {