From 0d3363e4e645066c324096f3fc9bc1a7d56a268a Mon Sep 17 00:00:00 2001 From: ngxson Date: Wed, 24 Apr 2024 18:27:39 +0200 Subject: [PATCH] llama_chat_get_typed_template --- llama.cpp | 4 ++-- llama.h | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/llama.cpp b/llama.cpp index 2d867bf3b..400713a5d 100644 --- a/llama.cpp +++ b/llama.cpp @@ -17307,7 +17307,7 @@ LLAMA_API int32_t llama_chat_get_model_template( } } -LLAMA_API llama_chat_template llama_chat_get_template_type(const char * tmpl) { +LLAMA_API llama_chat_template llama_chat_get_typed_template(const char * tmpl) { if (tmpl == nullptr) { return LLAMA_CHAT_TEMPLATE_NOT_SUPPORTED; } @@ -17596,7 +17596,7 @@ LLAMA_API int32_t llama_chat_apply_template( } // detect template type - llama_chat_template ttmpl = llama_chat_get_template_type(curr_tmpl.c_str()); + llama_chat_template ttmpl = llama_chat_get_typed_template(curr_tmpl.c_str()); bool support_system_message = llama_chat_support_system_message(ttmpl); if (ttmpl == LLAMA_CHAT_TEMPLATE_NOT_SUPPORTED) { return -1; diff --git a/llama.h b/llama.h index f89301644..4382dbe58 100644 --- a/llama.h +++ b/llama.h @@ -892,12 +892,12 @@ extern "C" { char * buf, int32_t length); - /// Get the enum llama_chat_template based on Jinja template + /// Get the value of enum llama_chat_template based on given Jinja template /// @param tmpl Jinja template (a string) - /// @return The currect enum llama_chat_template - LLAMA_API llama_chat_template llama_chat_get_template_type(const char * tmpl); + /// @return The correct value of enum llama_chat_template + LLAMA_API llama_chat_template llama_chat_get_typed_template(const char * tmpl); - /// Get the format prefix for a given message + /// Get the format prefix for a given message (based on role) /// @param tmpl Use enum llama_chat_template /// @param role The role of the current message /// @param prev_role The role of the previous message, can be nullptr @@ -911,7 +911,7 @@ extern "C" { char * buf, int32_t length); - /// Get the format postfix for a given message + /// Get the format postfix for a given message (based on role) /// @param tmpl Use enum llama_chat_template /// @param role The role of the current message /// @param prev_role The role of the previous message, can be nullptr