#[non_exhaustive]pub enum SamplerKind {
TopK {
top_k: i32,
},
TopP {
top_p: f32,
},
MinP {
min_p: f32,
},
TopKTopP {
top_k: i32,
top_p: f32,
},
}Expand description
Which sort-free sampler to run.
Note: only PartialEq is derived (not Eq) because top_p /
min_p are f32, and f32 doesn’t satisfy Eq (NaN != NaN).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
TopK
Keep only the top-K cells (K = top_k).
TopP
Keep the smallest top-prob set whose cumulative mass > top_p.
MinP
Keep cells prob >= min_p * row_max.
TopKTopP
Combined top-K then top-P filter. Canonical decode sampler.
Trait Implementations§
Source§impl Clone for SamplerKind
impl Clone for SamplerKind
Source§fn clone(&self) -> SamplerKind
fn clone(&self) -> SamplerKind
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 moreimpl Copy for SamplerKind
Source§impl Debug for SamplerKind
impl Debug for SamplerKind
Source§impl PartialEq for SamplerKind
impl PartialEq for SamplerKind
Source§fn eq(&self, other: &SamplerKind) -> bool
fn eq(&self, other: &SamplerKind) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SamplerKind
Auto Trait Implementations§
impl Freeze for SamplerKind
impl RefUnwindSafe for SamplerKind
impl Send for SamplerKind
impl Sync for SamplerKind
impl Unpin for SamplerKind
impl UnsafeUnpin for SamplerKind
impl UnwindSafe for SamplerKind
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