llama : move n_vocab from llama_sampler_data to penalty_sampler (#26520)

This matches how it is done for logit_bias and mirostat samplers, see
https://github.com/ggml-org/llama.cpp/pull/25262#discussion_r3703951151
This commit is contained in:
Oliver Simons 2026-08-04 08:02:49 +02:00 committed by GitHub
parent 22dc605c4e
commit 935cad6497
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 16 additions and 13 deletions

View file

@ -383,7 +383,7 @@ struct common_sampler * common_sampler_init(
samplers.push_back(llama_sampler_init_infill(vocab));
break;
case COMMON_SAMPLER_TYPE_PENALTIES:
samplers.push_back(llama_sampler_init_penalties(params.penalty_last_n, params.penalty_repeat, params.penalty_freq, params.penalty_present));
samplers.push_back(llama_sampler_init_penalties(llama_vocab_n_tokens(vocab), params.penalty_last_n, params.penalty_repeat, params.penalty_freq, params.penalty_present));
break;
case COMMON_SAMPLER_TYPE_ADAPTIVE_P:
// the `adaptive-p` sampler is like `dist` and `mirostat` in that it selects