Helper function to get a token from the combined, speculative sequence of inp and draft.
| 53 | |
| 54 | // Helper function to get a token from the combined, speculative sequence of inp and draft. |
| 55 | static 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: |
| 60 | constexpr int draft_min_sample_size_lax[LLAMA_NGRAM_MAX] = { 2, 2, 1, 1}; |
no test coverage detected