mtmd: quick fix token order

This commit is contained in:
bluebread 2025-11-24 08:16:32 +00:00
parent 206f8abc3c
commit 40e7e6e706
1 changed files with 12 additions and 2 deletions

View File

@ -316,8 +316,18 @@ int main(int argc, char ** argv) {
if (is_single_turn) {
g_is_generating = true;
if (params.prompt.find(mtmd_default_marker()) == std::string::npos) {
for (size_t i = 0; i < params.image.size(); i++) {
params.prompt += mtmd_default_marker();
if (mtmd_is_deepseekocr(ctx.ctx_vision.get())) {
std::string image_tokens = "";
for (size_t i = 0; i < params.image.size(); i++) {
image_tokens += mtmd_default_marker();
image_tokens += '\n';
}
params.prompt = image_tokens + params.prompt;
}
else {
for (size_t i = 0; i < params.image.size(); i++) {
params.prompt += mtmd_default_marker();
}
}
}
common_chat_msg msg;