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

Method get_token_data

llama.cpp:8720–8723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8718 , normalizer(1.0f / std::accumulate(logits, logits + n_vocab, 0.0f, sum_exp{max_l}))
8719 { }
8720 llama_token_data get_token_data(const llama_token token_id) const {
8721 constexpr auto p = std::numeric_limits<float>::quiet_NaN(); // never used
8722 return {token_id, logits[token_id], p};
8723 }
8724 // Return top k token_data by logit.
8725 std::vector<llama_token_data> top_k(size_t k) {
8726 std::vector<llama_token_data> min_heap; // min-heap by logit

Callers 6

add_kv_from_modelMethod · 0.80
try_add_bigramMethod · 0.80
llm_tokenizer_ugmMethod · 0.80
tokenizeMethod · 0.80
llm_tokenizer_rwkvMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected