From a15ceea15c233ddf0ead8119694844c817ddeca2 Mon Sep 17 00:00:00 2001 From: Jia Liu Date: Mon, 5 Aug 2024 11:34:44 +0800 Subject: [PATCH] delete llama_init_default_params() --- common/common.cpp | 10 +--------- common/common.h | 5 ++--- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/common/common.cpp b/common/common.cpp index 4bea9c832a301..ee7fbcba3c797 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -2039,16 +2039,8 @@ std::string fs_get_cache_file(const std::string & filename) { // // Model utils // -struct llama_init_result llama_init_default_params() { - struct llama_init_result result = { - /*.llama_model =*/ nullptr, - /*.llama_context =*/ nullptr, - }; - return result; -} - struct llama_init_result llama_init_from_gpt_params(gpt_params & params) { - auto iparams = llama_init_default_params(); + llama_init_result iparams; auto mparams = llama_model_params_from_gpt_params(params); llama_model * model = nullptr; diff --git a/common/common.h b/common/common.h index 40b253d0a48ea..51dcc0d3993f7 100644 --- a/common/common.h +++ b/common/common.h @@ -309,11 +309,10 @@ std::string fs_get_cache_file(const std::string & filename); // struct llama_init_result { - struct llama_model * model; - struct llama_context * context; + struct llama_model * model = nullptr; + struct llama_context * context = nullptr; }; -struct llama_init_result llama_init_default_params(); struct llama_init_result llama_init_from_gpt_params(gpt_params & params); struct llama_model_params llama_model_params_from_gpt_params (const gpt_params & params);