Skip to main content

sample_with_params

Function sample_with_params 

Source
pub fn sample_with_params(
    logits: &[f32],
    params: &SamplingParams,
    history: &[u32],
    rng_state: &mut u64,
) -> Result<Sampled>
Expand description

Pick the next token. Errors on empty or non-finite logits, a history token outside the vocabulary, or invalid params; never panics.