context : clear sets containing encoder output sequence ids before storing new values (#12470)

Co-authored-by: Stanisław Szymczyk <sszymczy@gmail.com>
This commit is contained in:
fairydreaming 2025-03-19 21:01:57 +01:00 committed by GitHub
parent 517b5ddbf0
commit 568013d0cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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