Skip to main content

sample

Function sample 

Source
pub fn sample(
    logits: &Matrix,
    temperature: f32,
    top_k: i32,
    top_p: f32,
    seed: u64,
) -> Result<Vec<u8>>
Expand description

Sample one byte from each FP32 logit row.

ยงErrors

Returns an error for an invalid 256-class logit contract, sampling contract, execution, or readback failure.