MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / common_sampler_accept

Function common_sampler_accept

subprojects/llama.cpp/common/sampling.cpp:361–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359}
360
361void common_sampler_accept(struct common_sampler * gsmpl, llama_token token, bool accept_grammar) {
362 if (!gsmpl) {
363 return;
364 }
365
366 const auto tm = gsmpl->tm();
367
368 if (gsmpl->grmr && accept_grammar) {
369 llama_sampler_accept(gsmpl->grmr, token);
370 }
371
372 llama_sampler_accept(gsmpl->chain, token);
373
374 gsmpl->prev.push_back(token);
375}
376
377void common_sampler_reset(struct common_sampler * gsmpl) {
378 if (!gsmpl) {

Callers 7

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

Calls 3

llama_sampler_acceptFunction · 0.85
tmMethod · 0.80
push_backMethod · 0.45

Tested by 1

draftMethod · 0.68