]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
server : fix crash with multimodal models without BOS token (#4904)
authormakomk <redacted>
Sat, 13 Jan 2024 14:16:11 +0000 (14:16 +0000)
committerGitHub <redacted>
Sat, 13 Jan 2024 14:16:11 +0000 (16:16 +0200)
examples/server/server.cpp

index c1ab8f9dc477c36b27aed7b8eda8476d6eda5758..7b33aea1f4fd5ce5f7b7d93f635b6b78928da5d2 100644 (file)
@@ -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);