pub enum Sampling {
Greedy,
TopK {
k: u32,
seed: Option<u64>,
},
TopP {
p: f64,
seed: Option<u64>,
},
}Expand description
Decoding strategy for the on-device model — the full set
FoundationModels exposes via GenerationOptions.SamplingMode.
Variants§
Greedy
Deterministic decoding.
TopK
Sample among the k most probable tokens.
TopP
Nucleus sampling: sample within the smallest set of tokens whose
cumulative probability reaches p.
Trait Implementations§
impl Copy for Sampling
impl StructuralPartialEq for Sampling
Auto Trait Implementations§
impl Freeze for Sampling
impl RefUnwindSafe for Sampling
impl Send for Sampling
impl Sync for Sampling
impl Unpin for Sampling
impl UnsafeUnpin for Sampling
impl UnwindSafe for Sampling
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