MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / llama_sampling_accept

Function llama_sampling_accept

common/sampling.cpp:218–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218void llama_sampling_accept(
219 struct llama_sampling_context * ctx_sampling,
220 struct llama_context * ctx_main,
221 llama_token id,
222 bool apply_grammar) {
223 ctx_sampling->prev.erase(ctx_sampling->prev.begin());
224 ctx_sampling->prev.push_back(id);
225
226 if (ctx_sampling->grammar != NULL && apply_grammar) {
227 llama_grammar_accept_token(ctx_main, ctx_sampling->grammar, id);
228 }
229}

Callers 5

mainFunction · 0.85
mainFunction · 0.85
update_slotsMethod · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 3

beginMethod · 0.45
push_backMethod · 0.45

Tested by 1

mainFunction · 0.68