diff --git a/llama.cpp b/llama.cpp index d865d14..4a8ccb3 160000 --- a/llama.cpp +++ b/llama.cpp @@ -1 +1 @@ -Subproject commit d865d1478cd4e403f82d793c2afcd0f943412f05 +Subproject commit 4a8ccb37ad9c9027cbcfd5548c19cdffe48d5197 diff --git a/patches/0001-Add-API-query-buffer-size.patch b/patches/0001-Add-API-query-buffer-size.patch index 82a3dd4..4185885 100644 --- a/patches/0001-Add-API-query-buffer-size.patch +++ b/patches/0001-Add-API-query-buffer-size.patch @@ -32,9 +32,9 @@ index c466cd88..15f3102c 100644 +const size_t llama_get_cpu_buffer(const struct llama_model * model) { + size_t buffer{0}; -+ for (const auto buf : model->bufs) { -+ if (strcmp(ggml_backend_buffer_name(buf), "CPU") == 0) { -+ buffer += ggml_backend_buffer_get_size(buf); ++ for (const auto& buf : model->bufs) { ++ if (strcmp(ggml_backend_buffer_name(buf.get()), "CPU") == 0) { ++ buffer += ggml_backend_buffer_get_size(buf.get()); + } + } + return buffer; @@ -42,9 +42,9 @@ index c466cd88..15f3102c 100644 + +const size_t llama_get_other_buffer(const struct llama_model * model) { + size_t buffer{0}; -+ for (const auto buf : model->bufs) { -+ if (strcmp(ggml_backend_buffer_name(buf), "CPU") != 0) { -+ buffer += ggml_backend_buffer_get_size(buf); ++ for (const auto& buf : model->bufs) { ++ if (strcmp(ggml_backend_buffer_name(buf.get()), "CPU") != 0) { ++ buffer += ggml_backend_buffer_get_size(buf.get()); + } + } + return buffer; diff --git a/src/llama_engine.cc b/src/llama_engine.cc index ec8e238..df305be 100644 --- a/src/llama_engine.cc +++ b/src/llama_engine.cc @@ -476,8 +476,8 @@ void LlamaEngine::SetFileLogger(int max_log_lines, } }, nullptr); - freopen(log_path.c_str(), "w", stderr); - freopen(log_path.c_str(), "w", stdout); + freopen(log_path.c_str(), "a", stderr); + freopen(log_path.c_str(), "a", stdout); } bool LlamaEngine::LoadModelImpl(std::shared_ptr json_body) {