Moved min_keep

Moved from conditions to a simple check at the end.
This commit is contained in:
MaggotHATE 2024-10-04 23:35:47 +05:00 committed by GitHub
parent 6d94ba2e58
commit 49cd2118e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1086,8 +1086,7 @@ static void llama_sample_xtc_apply(struct llama_sampler * smpl, llama_token_data
|| ctx->threshold >= 1.0f
|| ctx->threshold_max <= 0.0f
|| ctx->threshold_max <= ctx->threshold
|| cur_p->size <= 2
|| ctx->min_keep <= 2) {
|| cur_p->size <= 2) {
return;
}
// chance is calculated on init and on each reset
@ -1116,6 +1115,8 @@ static void llama_sample_xtc_apply(struct llama_sampler * smpl, llama_token_data
// resizing now that penalized tokens are at the back
cur_p->size = cur_p->size - found + 1;
if (cur_p->size < ctx->min_keep) cur_p->size = ctx->min_keep;
}
}