Skip to content

Commit 3b59021

Browse files
fix(memory): Fix condition for partial erasure failure if p0 > pos
Signed-off-by: Gabe Goodhart <[email protected]> Co-authored-by: compilade <[email protected]>
1 parent 24aff7f commit 3b59021

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/llama-memory-recurrent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ bool llama_memory_recurrent::seq_rm(llama_seq_id seq_id, llama_pos p0, llama_pos
162162
if (tail_id >= 0) {
163163
const auto & cell = cells[tail_id];
164164
// partial intersection is invalid if it includes the final pos
165-
if ((0 < p0 && p1 > cell.pos)) {
165+
if ((0 < p0 && p0 <= cell.pos && p1 > cell.pos)) {
166166
//printf("[DEBUG] inside `llama_memory_recurrent::seq_rm`: partial intersection is invalid, so returning false\n");
167167
return false;
168168
}

0 commit comments

Comments
 (0)