MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / common_sampler_accept

Function common_sampler_accept

common/sampling.cpp:434–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432}
433
434void common_sampler_accept(struct common_sampler * gsmpl, llama_token token, bool accept_grammar) {
435 if (!gsmpl) {
436 return;
437 }
438
439 const auto tm = gsmpl->tm();
440
441 // grammar_should_apply() checks the reasoning budget state, so calculate this before we accept
442 accept_grammar = accept_grammar && grammar_should_apply(gsmpl);
443
444 llama_sampler_accept(gsmpl->rbudget, token);
445
446 if (gsmpl->grmr && accept_grammar) {
447 llama_sampler_accept(gsmpl->grmr, token);
448 }
449
450 llama_sampler_accept(gsmpl->chain, token);
451
452 gsmpl->prev.push_back(token);
453}
454
455void common_sampler_reset(struct common_sampler * gsmpl) {
456 if (!gsmpl) {

Callers 12

mainFunction · 0.85
generate_responseFunction · 0.85
mainFunction · 0.85
init_samplerMethod · 0.85
update_slotsMethod · 0.85
draftMethod · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 4

grammar_should_applyFunction · 0.85
llama_sampler_acceptFunction · 0.85
tmMethod · 0.80
push_backMethod · 0.45

Tested by 2

draftMethod · 0.68
mainFunction · 0.68