common : restore grammar-based rejection sampling (#18137)

* common : restart grammar-based rejection sampling

* sampling : allow null samplers
This commit is contained in:
Georgi Gerganov 2025-12-17 19:46:00 +02:00 committed by GitHub
parent a2c199e479
commit 4301e27319
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 76 additions and 43 deletions

View file

@ -315,7 +315,7 @@ llama_tokens common_speculative_gen_draft(
for (int i = 0; i < params.n_draft; ++i) {
common_batch_clear(batch);
common_sampler_sample(smpl, ctx_dft, 0);
common_sampler_sample(smpl, ctx_dft, 0, true);
const auto * cur_p = common_sampler_get_candidates(smpl, true);