Skip to content

Commit ac41b54

Browse files
committed
fix chat template
1 parent e7a485c commit ac41b54

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

common/arg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3435,7 +3435,7 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
34353435
[](common_params & params) {
34363436
params.use_jinja = true;
34373437
}
3438-
).set_examples({LLAMA_EXAMPLE_SERVER, LLAMA_EXAMPLE_MAIN}).set_env("LLAMA_ARG_JINJA"));
3438+
).set_examples({LLAMA_EXAMPLE_SERVER, LLAMA_EXAMPLE_MAIN, LLAMA_EXAMPLE_MTMD}).set_env("LLAMA_ARG_JINJA"));
34393439
add_opt(common_arg(
34403440
{"--reasoning-format"}, "FORMAT",
34413441
"controls whether thought tags are allowed and/or extracted from the response, and in which format they're returned; one of:\n"

common/chat.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,11 @@ common_chat_templates_ptr common_chat_templates_init(
579579
"{%- if false %}");
580580
}
581581

582+
// TODO @ngxson : hot fix for PaddleOCR
583+
if (default_template_src.find("<|IMAGE_PLACEHOLDER|>") != std::string::npos) {
584+
string_replace_all(default_template_src, "<|IMAGE_START|><|IMAGE_PLACEHOLDER|><|IMAGE_END|>", "");
585+
}
586+
582587
std::string token_bos = bos_token_override;
583588
std::string token_eos = eos_token_override;
584589
bool add_bos = false;

0 commit comments

Comments
 (0)