Skip to content

Commit 56a14dd

Browse files
author
ochafik
committed
fix mistral chat test: need empty tokens
1 parent b152729 commit 56a14dd

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

common/chat-template.hpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -463,12 +463,8 @@ class chat_template {
463463
{"messages", actual_messages},
464464
{"add_generation_prompt", inputs.add_generation_prompt},
465465
}));
466-
if (opts.use_bos_token) {
467-
context->set("bos_token", bos_token_);
468-
}
469-
if (opts.use_eos_token) {
470-
context->set("eos_token", eos_token_);
471-
}
466+
context->set("bos_token", opts.use_bos_token ? bos_token_ : "");
467+
context->set("eos_token", opts.use_eos_token ? eos_token_ : "");
472468
if (opts.define_strftime_now) {
473469
auto now = inputs.now;
474470
context->set("strftime_now", Value::callable([now](const std::shared_ptr<minja::Context> &, minja::ArgumentsValue & args) {

0 commit comments

Comments
 (0)