llm_chain_llama_sys

Function llama_sample_top_k

Source
pub unsafe extern "C" fn llama_sample_top_k(
    ctx: *mut llama_context,
    candidates: *mut llama_token_data_array,
    k: c_int,
    min_keep: usize,
)
Expand description

@details Top-K sampling described in academic paper “The Curious Case of Neural Text Degeneration” https://arxiv.org/abs/1904.09751