diff --git a/llama_cpp_vendor/CMakeLists.txt b/llama_cpp_vendor/CMakeLists.txt index dd83ead..6f8ac37 100644 --- a/llama_cpp_vendor/CMakeLists.txt +++ b/llama_cpp_vendor/CMakeLists.txt @@ -11,7 +11,7 @@ find_package(ament_cmake REQUIRED) FetchContent_Declare( llama GIT_REPOSITORY https://github.com/ggerganov/llama.cpp.git - GIT_TAG b4393 + GIT_TAG b4418 ) option(LLAMA_BUILD_COMMON "llama: build common utils library" ON) diff --git a/llama_ros/include/llama_ros/llama.hpp b/llama_ros/include/llama_ros/llama.hpp index f7ef488..2526be2 100644 --- a/llama_ros/include/llama_ros/llama.hpp +++ b/llama_ros/include/llama_ros/llama.hpp @@ -233,9 +233,10 @@ class Llama { struct common_params params; // model + struct common_init_result llama_init; struct llama_context *ctx; struct llama_model *model; - std::vector lora_adapters; + std::vector lora_adapters; struct common_sampler *sampler; struct ggml_threadpool *threadpool; struct ggml_threadpool *threadpool_batch; diff --git a/llama_ros/src/llama_ros/llama.cpp b/llama_ros/src/llama_ros/llama.cpp index 948f634..44cbcb4 100644 --- a/llama_ros/src/llama_ros/llama.cpp +++ b/llama_ros/src/llama_ros/llama.cpp @@ -43,10 +43,10 @@ Llama::Llama(const struct common_params ¶ms, std::string system_prompt) llama_backend_init(); llama_numa_init(this->params.numa); - struct common_init_result llama_init = common_init_from_params(this->params); - this->model = llama_init.model; - this->ctx = llama_init.context; - this->lora_adapters = llama_init.lora_adapters; + this->llama_init = common_init_from_params(this->params); + this->model = llama_init.model.get(); + this->ctx = llama_init.context.get(); + this->lora_adapters = this->params.lora_adapters; if (this->model == NULL) { LLAMA_LOG_ERROR("Unable to load model"); diff --git a/llama_ros/src/llama_utils/llama_params.cpp b/llama_ros/src/llama_utils/llama_params.cpp index 05ae8fa..bf23f86 100644 --- a/llama_ros/src/llama_utils/llama_params.cpp +++ b/llama_ros/src/llama_utils/llama_params.cpp @@ -310,7 +310,8 @@ struct LlamaParams llama_utils::get_llama_params( scale = 1.0; } - params.params.lora_adapters.push_back({lora_adapters.at(i), scale}); + params.params.lora_adapters.push_back( + {lora_adapters.at(i), scale, nullptr}); } } }