From e93a6ee7c74f79b076ad03a79b3be5c68fc41bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Szymczyk?= Date: Wed, 19 Mar 2025 19:07:59 +0100 Subject: [PATCH] context : clear sets of encoder output sequence ids before storing new values. --- src/llama-context.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/llama-context.cpp b/src/llama-context.cpp index 664703a896701..5bec63e2e79ff 100644 --- a/src/llama-context.cpp +++ b/src/llama-context.cpp @@ -1153,6 +1153,7 @@ int llama_context::encode(llama_batch & inp_batch) { // remember the sequence ids used during the encoding - needed for cross attention later cross.seq_ids_enc.resize(n_tokens); for (int32_t i = 0; i < n_tokens; i++) { + cross.seq_ids_enc[i].clear(); for (int s = 0; s < ubatch.n_seq_id[i]; s++) { llama_seq_id seq_id = ubatch.seq_id[i][s]; cross.seq_ids_enc[i].insert(seq_id);