server : fix crash with multimodal models without BOS token (#4904)

This commit is contained in:
makomk 2024-01-13 14:16:11 +00:00 committed by GitHub
parent 15ebe59210
commit ee8243adaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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);