From 3b36f2068e38f16c45efc37dd3d1c9d11b0d1fd3 Mon Sep 17 00:00:00 2001 From: Aidan Thornton Date: Fri, 12 Jan 2024 23:38:56 +0000 Subject: [PATCH] server: fix crash in multimodal models with add_bos_token = false --- examples/server/server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/server/server.cpp b/examples/server/server.cpp index c1ab8f9dc..7b33aea1f 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -1835,7 +1835,7 @@ struct llama_server_context slot.cache_tokens = prompt_tokens; - if (slot.n_past == slot.num_prompt_tokens) + if (slot.n_past == slot.num_prompt_tokens && slot.n_past > 0) { // we have to evaluate at least 1 token to generate logits. LOG_TEE("slot %d : we have to evaluate at least 1 token to generate logits\n", slot.id);