Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions common/chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,12 @@ common_chat_templates_ptr common_chat_templates_init(
"{%- if false %}");
}

// TODO @megemini : this is a temporary fix for PaddleOCR image placeholder
if (default_template_src.find("<|IMAGE_START|><|IMAGE_PLACEHOLDER|><|IMAGE_END|>") != std::string::npos) {
string_replace_all(default_template_src, "image", "media_marker");
string_replace_all(default_template_src, "\"<|IMAGE_START|><|IMAGE_PLACEHOLDER|><|IMAGE_END|>\"", "content[\"text\"]");
}

std::string token_bos = bos_token_override;
std::string token_eos = eos_token_override;
bool add_bos = false;
Expand Down
Loading