Skip to content

Commit

Permalink
llama.cpp updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mgonzs13 committed Jan 5, 2025
1 parent f0a0af9 commit b9e5d18
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion llama_cpp_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion llama_ros/include/llama_ros/llama.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<struct common_lora_adapter_container> lora_adapters;
std::vector<common_lora_adapter_info> lora_adapters;
struct common_sampler *sampler;
struct ggml_threadpool *threadpool;
struct ggml_threadpool *threadpool_batch;
Expand Down
8 changes: 4 additions & 4 deletions llama_ros/src/llama_ros/llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Llama::Llama(const struct common_params &params, 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");
Expand Down
3 changes: 2 additions & 1 deletion llama_ros/src/llama_utils/llama_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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});
}
}
}
Expand Down

0 comments on commit b9e5d18

Please sign in to comment.