diff --git a/tools/server/server-context.cpp b/tools/server/server-context.cpp index b79a5270b5..6f737d94d0 100644 --- a/tools/server/server-context.cpp +++ b/tools/server/server-context.cpp @@ -2493,7 +2493,7 @@ private: bool has_mtmd = false; // check if we should process the image - if (slot.prompt.n_tokens() < slot.task->n_tokens() && input_tokens[slot.prompt.n_tokens()] == LLAMA_TOKEN_NULL) { + while (slot.prompt.n_tokens() < slot.task->n_tokens() && input_tokens[slot.prompt.n_tokens()] == LLAMA_TOKEN_NULL) { // process the image size_t n_tokens_out = 0; int32_t res = input_tokens.process_chunk(ctx, mctx, slot.prompt.n_tokens(), slot.prompt.tokens.pos_next(), slot.id, n_tokens_out);