pub struct SamplerConfig {
pub temperature: f32,
pub top_k: usize,
pub top_p: f32,
pub min_p: f32,
pub typical_p: f32,
pub repeat_penalty: f32,
pub repeat_window: usize,
pub frequency_penalty: f32,
pub presence_penalty: f32,
pub seed: Option<u64>,
pub mirostat: Option<MirostatConfig>,
}Expand description
Sampler configuration
Fields§
§temperature: f32Temperature for softmax scaling (higher = more random)
top_k: usizeTop-K: only consider the K most likely tokens
top_p: f32Top-P (nucleus): only consider tokens with cumulative probability <= p
min_p: f32Min-P: only consider tokens with probability >= min_p * max_prob
typical_p: f32Typical-P sampling
repeat_penalty: f32Repetition penalty
repeat_window: usizeWindow size for repetition penalty
frequency_penalty: f32Frequency penalty
presence_penalty: f32Presence penalty
seed: Option<u64>Random seed (None for random)
mirostat: Option<MirostatConfig>Mirostat sampling (overrides other sampling methods if set)
Implementations§
Trait Implementations§
Source§impl Clone for SamplerConfig
impl Clone for SamplerConfig
Source§fn clone(&self) -> SamplerConfig
fn clone(&self) -> SamplerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SamplerConfig
impl Debug for SamplerConfig
Auto Trait Implementations§
impl Freeze for SamplerConfig
impl RefUnwindSafe for SamplerConfig
impl Send for SamplerConfig
impl Sync for SamplerConfig
impl Unpin for SamplerConfig
impl UnsafeUnpin for SamplerConfig
impl UnwindSafe for SamplerConfig
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