mirror of
https://github.com/ikawrakow/ik_llama.cpp.git
synced 2026-02-22 14:14:32 +00:00
Fix adaptive p sampler bug with string ban (#1287)
* adaptive p: upadte internal state only if not rewinding * adaptive p: conditional update for speculative decoding * adaptive p: refactor to rewind instead of update * adaptive p fix: better comments * fix rewind check * add record to handle multi-token rewind * better comment
This commit is contained in:
@@ -142,6 +142,16 @@ void common_sampler_reset(common_sampler * ctx) {
|
||||
llama_sampler_dry_reset(ctx->smpl);
|
||||
}
|
||||
|
||||
void common_sampler_review(common_sampler * ctx) {
|
||||
const bool record = ctx->record_samplers;
|
||||
const bool rewind = ctx->rewind_samplers;
|
||||
|
||||
llama_review_adaptive_p(ctx->adapt_p_ctx, record, rewind);
|
||||
|
||||
ctx->record_samplers = false;
|
||||
ctx->rewind_samplers = false;
|
||||
}
|
||||
|
||||
void llama_sampling_set_rng_seed(struct common_sampler * ctx, uint32_t seed) {
|
||||
if (seed == LLAMA_DEFAULT_SEED) {
|
||||
seed = std::random_device{}();
|
||||
|
||||
Reference in New Issue
Block a user