common, server : surface min_keep as its own parameter (#5567)

* Feature - surface min_keep as its own parameter

* Updated README with min_keep param
This commit is contained in:
Robey Holderith 2024-02-18 11:11:16 -08:00 committed by GitHub
parent c145f8a132
commit 5ee99c32f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 14 additions and 1 deletions

View file

@ -248,7 +248,10 @@ static llama_token llama_sampling_sample_impl(
llama_sample_temp(ctx_main, &cur_p, temp);
id = llama_sample_token_mirostat_v2(ctx_main, &cur_p, mirostat_tau, mirostat_eta, &ctx_sampling->mirostat_mu);
} else {
sampler_queue(ctx_main, params, cur_p, 1);
// temperature sampling
size_t min_keep = std::max(1, params.min_keep);
sampler_queue(ctx_main, params, cur_p, min_keep);
id = llama_sample_token(ctx_main, &cur_p);