Simplified algorithm since threshold_max is removed

This commit is contained in:
MaggotHATE 2024-10-14 16:10:13 +05:00
parent dfef2c4c37
commit 436a9919e3

View file

@ -1101,13 +1101,7 @@ static void llama_sample_xtc_apply(struct llama_sampler * smpl, llama_token_data
} }
if (cur_p->size - pos_last >= ctx->min_keep && pos_last > 0) { if (cur_p->size - pos_last >= ctx->min_keep && pos_last > 0) {
cur_p->data += pos_last;
size_t last_idx = cur_p->size - pos_last;
for (size_t i = 0; i <= last_idx; ++i) {
cur_p->data[i] = cur_p->data[i + pos_last];
}
cur_p->size = cur_p->size - pos_last; cur_p->size = cur_p->size - pos_last;
} }
} }