| 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 |
no outgoing calls
no test coverage detected