Skip to content

Commit d0b1053

Browse files
authored
Fixed incorrect min_keep check
1 parent 6feb6b3 commit d0b1053

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/llama-sampling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ static void llama_sample_xtc_apply(struct llama_sampler * smpl, llama_token_data
11091109

11101110
size_t to_remove = pos_last - (1 + pos_first);
11111111

1112-
if (to_remove < ctx->min_keep || to_remove < 1) return;
1112+
if (cur_p->size - to_remove < ctx->min_keep || to_remove < 1) return;
11131113

11141114
for (size_t i = pos_first + 1; i < cur_p->size - to_remove + 1; ++i) {
11151115
cur_p->data[i] = cur_p->data[i + to_remove];

0 commit comments

Comments
 (0)