llama : fix llama_model_chat_template with template name (LLM_KV with suffix) (#14050)

This commit is contained in:
Sigbjørn Skjæret 2025-06-07 14:13:12 +02:00 committed by GitHub
parent 745aa5319b
commit 0974ad7a7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 5 deletions

View file

@ -13788,7 +13788,7 @@ uint64_t llama_model_size(const llama_model * model) {
}
const char * llama_model_chat_template(const llama_model * model, const char * name) {
const auto key = name ? LLM_KV(model->arch, name)(LLM_KV_TOKENIZER_CHAT_TEMPLATE_N)
const auto key = name ? LLM_KV(model->arch, name)(LLM_KV_TOKENIZER_CHAT_TEMPLATE)
: LLM_KV(model->arch)(LLM_KV_TOKENIZER_CHAT_TEMPLATE);
const auto & it = model->gguf_kv.find(key);
if (it == model->gguf_kv.end()) {