Trait chat_flame_backend::llm::sampler::Sampler
source · pub trait Sampler {
// Required method
fn sample(&mut self, logits: &Tensor) -> Result<u32>;
}
Expand description
A trait for sampling a token based on logits output.
This trait defines a method for sampling a single token from a distribution represented by logits.
Required Methods§
Implementations on Foreign Types§
source§impl Sampler for LogitsProcessor
impl Sampler for LogitsProcessor
Implementation of Sampler
for the LogitsProcessor
from candle_transformers
.
Implementors§
impl Sampler for DummySampler
Implementation of Sampler
for DummySampler
.