pub struct SamplerConfig {
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub top_k: Option<usize>,
pub repetition_penalty: Option<f32>,
pub max_new_tokens: Option<usize>,
}Expand description
Default sampler parameters, typically from generation_config.json.
Fields§
§temperature: Option<f32>Sampling temperature (1.0 = neutral, 0.0 = greedy).
top_p: Option<f32>Top-p (nucleus) threshold.
top_k: Option<usize>Top-k cutoff.
repetition_penalty: Option<f32>Repetition penalty.
max_new_tokens: Option<usize>Suggested maximum new tokens.
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 (const: unstable) · 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
Source§impl Default for SamplerConfig
impl Default for SamplerConfig
Source§fn default() -> SamplerConfig
fn default() -> SamplerConfig
Returns the “default value” for a type. Read more
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