Skip to content

Commit 40e7e6e

Browse files
committed
mtmd: quick fix token order
1 parent 206f8ab commit 40e7e6e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tools/mtmd/mtmd-cli.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,18 @@ int main(int argc, char ** argv) {
316316
if (is_single_turn) {
317317
g_is_generating = true;
318318
if (params.prompt.find(mtmd_default_marker()) == std::string::npos) {
319-
for (size_t i = 0; i < params.image.size(); i++) {
320-
params.prompt += mtmd_default_marker();
319+
if (mtmd_is_deepseekocr(ctx.ctx_vision.get())) {
320+
std::string image_tokens = "";
321+
for (size_t i = 0; i < params.image.size(); i++) {
322+
image_tokens += mtmd_default_marker();
323+
image_tokens += '\n';
324+
}
325+
params.prompt = image_tokens + params.prompt;
326+
}
327+
else {
328+
for (size_t i = 0; i < params.image.size(); i++) {
329+
params.prompt += mtmd_default_marker();
330+
}
321331
}
322332
}
323333
common_chat_msg msg;

0 commit comments

Comments
 (0)