pub struct SampleOpts {Show 26 fields
pub temperature: f32,
pub top_k: usize,
pub top_p: f32,
pub seed: u64,
pub greedy: bool,
pub dynamic_temp: Option<(f32, f32)>,
pub dynamic_temp_exponent: f32,
pub typical_p: f32,
pub top_n_sigma: f32,
pub xtc_threshold: f32,
pub xtc_prob: f32,
pub dry_multiplier: f32,
pub dry_base: f32,
pub dry_allowed_length: usize,
pub dry_max_ngram: usize,
pub dry_sequence_breakers: [u32; 32],
pub dry_sequence_breakers_len: u8,
pub mirostat: MirostatMode,
pub mirostat_tau: f32,
pub mirostat_eta: f32,
pub mirostat_m: usize,
pub repetition_penalty: f32,
pub frequency_penalty: f32,
pub presence_penalty: f32,
pub repetition_window: usize,
pub min_keep: usize,
}Fields§
§temperature: f32§top_k: usize§top_p: f32§seed: u64§greedy: bool§dynamic_temp: Option<(f32, f32)>§dynamic_temp_exponent: f32§typical_p: f32§top_n_sigma: f32§xtc_threshold: f32§xtc_prob: f32§dry_multiplier: f32§dry_base: f32§dry_allowed_length: usize§dry_max_ngram: usize§dry_sequence_breakers: [u32; 32]DRY sequence-break tokens packed into a fixed-size array.
Use [SampleOpts::dry_breakers] to read the slice or
[SampleOpts::with_dry_breakers] to set it.
dry_sequence_breakers_len: u8§mirostat: MirostatMode§mirostat_tau: f32§mirostat_eta: f32§mirostat_m: usize§repetition_penalty: f32§frequency_penalty: f32§presence_penalty: f32§repetition_window: usize§min_keep: usizeImplementations§
Source§impl SampleOpts
impl SampleOpts
pub fn greedy() -> SampleOpts
pub fn temperature(temp: f32, seed: u64) -> SampleOpts
pub fn with_top_k(self, k: usize) -> SampleOpts
pub fn with_top_p(self, p: f32) -> SampleOpts
pub fn with_dynamic_temp(self, min: f32, max: f32) -> SampleOpts
pub fn with_typical_p(self, p: f32) -> SampleOpts
pub fn with_top_n_sigma(self, n: f32) -> SampleOpts
pub fn with_xtc(self, threshold: f32, prob: f32) -> SampleOpts
pub fn with_dry( self, multiplier: f32, base: f32, allowed_length: usize, ) -> SampleOpts
pub fn with_mirostat_v1(self, tau: f32, eta: f32) -> SampleOpts
pub fn with_mirostat_v2(self, tau: f32, eta: f32) -> SampleOpts
pub fn with_repetition_penalty(self, p: f32) -> SampleOpts
pub fn with_frequency_presence( self, frequency: f32, presence: f32, ) -> SampleOpts
Sourcepub fn is_classic(&self) -> bool
pub fn is_classic(&self) -> bool
True when only classic top-k/top-p/temperature/greedy is active —
callers can stay on the cheap inline path. Returns false the
moment any advanced sampler is engaged so they get routed
through SamplerChain.
Sourcepub fn into_chain(&self) -> SamplerChain
pub fn into_chain(&self) -> SamplerChain
Build a rlx_runtime::SamplerChain from these options. See
rlx_runtime::SampleOpts::into_chain — same ordering.
Trait Implementations§
Source§impl Clone for SampleOpts
impl Clone for SampleOpts
Source§fn clone(&self) -> SampleOpts
fn clone(&self) -> SampleOpts
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 SampleOpts
Auto Trait Implementations§
impl Freeze for SampleOpts
impl RefUnwindSafe for SampleOpts
impl Send for SampleOpts
impl Sync for SampleOpts
impl Unpin for SampleOpts
impl UnsafeUnpin for SampleOpts
impl UnwindSafe for SampleOpts
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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