Skip to content

Commit cec1ad7

Browse files
authored
Fix warning logic of missing eos/bos tokens
1 parent 9d8ebd6 commit cec1ad7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

common/common.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1855,8 +1855,8 @@ common_chat_templates common_chat_templates_from_model(const struct llama_model
18551855
}
18561856
const auto get_token = [&](llama_token token, const char * name, const char * jinja_variable_name) {
18571857
if (token == LLAMA_TOKEN_NULL) {
1858-
if (default_template_src.find(jinja_variable_name) != std::string::npos
1859-
|| template_tool_use_src.find(jinja_variable_name) != std::string::npos) {
1858+
if (default_template_src.find(jinja_variable_name) == std::string::npos
1859+
&& template_tool_use_src.find(jinja_variable_name) == std::string::npos) {
18601860
LOG_WRN("%s: warning: vocab does not have a %s token, jinja template won't work as intended.\n", __func__, name);
18611861
}
18621862
return std::string();

0 commit comments

Comments
 (0)