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

Function get_token

smallthinker/common/ngram-cache.cpp:55–57  ·  view source on GitHub ↗

Helper function to get a token from the combined, speculative sequence of inp and draft.

Source from the content-addressed store, hash-verified

53
54// Helper function to get a token from the combined, speculative sequence of inp and draft.
55static llama_token get_token(const std::vector<llama_token> & inp, const std::vector<llama_token> & draft, const size_t i) {
56 return i < inp.size() ? inp[i] : draft[1 + i - inp.size()];
57}
58
59// If sample size or percentage are below these thresholds the draft is aborted early:
60constexpr int draft_min_sample_size_lax[LLAMA_NGRAM_MAX] = { 2, 2, 1, 1};

Callers 6

common_ngram_cache_draftFunction · 0.85
parserMethod · 0.85
parseMethod · 0.85
sax_parseMethod · 0.85
sax_parse_internalMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected