Skip to content

Commit 6c17323

Browse files
update hunyuan dense chat template
Signed-off-by: stevenkuang <[email protected]>
1 parent 3ecc5d3 commit 6c17323

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

convert_hf_to_gguf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7533,6 +7533,7 @@ class HunYuanModel(TextModel):
75337533
def set_vocab(self):
75347534
if (self.dir_model / "tokenizer.json").is_file():
75357535
self._set_vocab_gpt2()
7536+
self.gguf_writer.add_add_bos_token(True)
75367537
else:
75377538
from transformers import AutoTokenizer
75387539
tokenizer = AutoTokenizer.from_pretrained(self.dir_model, trust_remote_code=True)

src/llama-chat.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -712,9 +712,7 @@ int32_t llm_chat_apply_template(
712712
std::string role(chat[i]->role);
713713
if (i == 0) {
714714
if (role == "system") {
715-
ss << "<|hy_begin▁of▁sentence|>" << chat[i]->content << "<|hy_place▁holder▁no▁3|>";
716-
} else {
717-
ss << "<|hy_begin▁of▁sentence|>";
715+
ss << chat[i]->content << "<|hy_place▁holder▁no▁3|>";
718716
}
719717
}
720718

0 commit comments

Comments
 (0)