]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
context : clear sets containing encoder output sequence ids before storing new values...
authorfairydreaming <redacted>
Wed, 19 Mar 2025 20:01:57 +0000 (21:01 +0100)
committerGitHub <redacted>
Wed, 19 Mar 2025 20:01:57 +0000 (21:01 +0100)
Co-authored-by: Stanisław Szymczyk <redacted>
src/llama-context.cpp

index 664703a896701a9988a23fd79405f00154622bb0..5bec63e2e79ff81fde3fa2ed12fbbfc32ea8bca5 100644 (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);