Skip to content

Commit 843f453

Browse files
committed
fix: llama_memory_seq_rm(mem, -1, ...)
because GGML_ASSERT(seq_id >= 0 && (size_t) seq_id < seq_to_stream.size()); in llama_kv_cache_unified::seq_rm
1 parent 79c1160 commit 843f453

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/lookahead/lookahead.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ int main(int argc, char ** argv) {
429429

430430
// KV cache management
431431
// if no verification token matched, we simply remove all cells from this batch -> no fragmentation
432-
llama_memory_seq_rm(mem, -1, n_past, -1);
432+
llama_memory_seq_rm(mem, 0, n_past, -1);
433433

434434
if (seq_id_best != 0) {
435435
// if a verification token matched, we keep the best sequence and remove the rest

tools/main/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ int main(int argc, char ** argv) {
354354
}
355355

356356
// remove any "future" tokens that we might have inherited from the previous session
357-
llama_memory_seq_rm(mem, -1, n_matching_session_tokens, -1);
357+
llama_memory_seq_rm(mem, 0, n_matching_session_tokens, -1);
358358
}
359359

360360
LOG_DBG("recalculate the cached logits (check): embd_inp.size() %zu, n_matching_session_tokens %zu, embd_inp.size() %zu, session_tokens.size() %zu\n",

0 commit comments

Comments
 (0)