pub enum SamplerStep {
Temperature(f32),
RepetitionPenalty {
penalty: f32,
last_n: usize,
tokens: Vec<u32>,
},
TopK(usize),
TopP(f32),
MinP(f32),
Typical(f32),
Mirostat2 {
tau: f32,
eta: f32,
},
Greedy,
}Expand description
A single step in a SamplerChain pipeline.
Steps are applied in order to the logit vector before final sampling.
Variants§
Temperature(f32)
Divide logits by temperature. Values near 0 produce near-greedy output.
RepetitionPenalty
Penalise previously-seen tokens to reduce repetition.
Fields
TopK(usize)
Keep only the top-k highest-logit candidates.
TopP(f32)
Nucleus (top-p) filtering.
MinP(f32)
Min-P filtering (min fraction of top token probability).
Typical(f32)
Locally typical sampling with probability mass p.
Mirostat2
Mirostat v2 with given tau and eta.
Greedy
Always pick the argmax (no randomness).
Trait Implementations§
Source§impl Clone for SamplerStep
impl Clone for SamplerStep
Source§fn clone(&self) -> SamplerStep
fn clone(&self) -> SamplerStep
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SamplerStep
impl RefUnwindSafe for SamplerStep
impl Send for SamplerStep
impl Sync for SamplerStep
impl Unpin for SamplerStep
impl UnsafeUnpin for SamplerStep
impl UnwindSafe for SamplerStep
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more