pub struct SamplingConfigBuilder { /* private fields */ }Expand description
Sampling configuration builder
Implementations§
Source§impl SamplingConfigBuilder
impl SamplingConfigBuilder
Sourcepub fn with_temperature(self, temperature: f32) -> Self
pub fn with_temperature(self, temperature: f32) -> Self
Add temperature scaling
Sourcepub fn with_top_k(self, k: usize) -> Self
pub fn with_top_k(self, k: usize) -> Self
Add top-k filtering
Sourcepub fn with_top_p(self, p: f32) -> Self
pub fn with_top_p(self, p: f32) -> Self
Add top-p filtering
Sourcepub fn with_repetition_penalty(self, penalty: f32) -> Self
pub fn with_repetition_penalty(self, penalty: f32) -> Self
Add repetition penalty
Sourcepub fn with_sampler(self, sampler: Box<dyn Sampler>) -> Self
pub fn with_sampler(self, sampler: Box<dyn Sampler>) -> Self
Set sampler (greedy vs multinomial)
Sourcepub fn build(self) -> SamplingConfig
pub fn build(self) -> SamplingConfig
Build sampling configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SamplingConfigBuilder
impl !RefUnwindSafe for SamplingConfigBuilder
impl Send for SamplingConfigBuilder
impl Sync for SamplingConfigBuilder
impl Unpin for SamplingConfigBuilder
impl UnsafeUnpin for SamplingConfigBuilder
impl !UnwindSafe for SamplingConfigBuilder
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