Skip to content

Commit 820de57

Browse files
authored
chat : fix kimi-k2 chat template (ggml-org#14852)
1 parent cb4a63a commit 820de57

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/llama-arch.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,12 +1933,6 @@ static const std::map<llm_arch, std::map<llm_tensor, const char *>> LLM_TENSOR_N
19331933
{ LLM_TENSOR_TOKEN_EMBD_NORM, "token_embd_norm" },
19341934
}
19351935
},
1936-
{
1937-
LLM_ARCH_UNKNOWN,
1938-
{
1939-
{ LLM_TENSOR_TOKEN_EMBD, "token_embd" },
1940-
},
1941-
},
19421936
{
19431937
LLM_ARCH_DREAM,
19441938
{
@@ -1956,6 +1950,12 @@ static const std::map<llm_arch, std::map<llm_tensor, const char *>> LLM_TENSOR_N
19561950
{ LLM_TENSOR_FFN_UP, "blk.%d.ffn_up" },
19571951
},
19581952
},
1953+
{
1954+
LLM_ARCH_UNKNOWN,
1955+
{
1956+
{ LLM_TENSOR_TOKEN_EMBD, "token_embd" },
1957+
},
1958+
},
19591959
};
19601960

19611961
static const std::map<llm_tensor, llm_tensor_info> LLM_TENSOR_INFOS = {

src/llama-chat.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -718,10 +718,9 @@ int32_t llm_chat_apply_template(
718718
}
719719

720720
ss << message->content << "<|im_end|>";
721-
722-
if (add_ass) {
723-
ss << "<|im_assistant|>assistant<|im_middle|>";
724-
}
721+
}
722+
if (add_ass) {
723+
ss << "<|im_assistant|>assistant<|im_middle|>";
725724
}
726725
} else {
727726
// template not supported

0 commit comments

Comments
 (0)