Skip to content

Commit d43e4f6

Browse files
author
ochafik
committed
Merge branch 'sync-minja-4' into r1-toolcall
2 parents 86994db + f12e350 commit d43e4f6

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
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) {

common/chat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static void foreach_function(const json & tools, const std::function<void(const
175175
}
176176

177177
static std::string apply(
178-
const common_chat_template & tmpl,
178+
const common_chat_template & tmpl,
179179
const nlohmann::ordered_json & messages,
180180
const nlohmann::ordered_json & tools,
181181
bool add_generation_prompt,

0 commit comments

Comments
 (0)