pub struct TextGenerationConfig { /* private fields */ }Expand description
Portable sampling inputs for one text-generation session.
Implementations§
Source§impl TextGenerationConfig
impl TextGenerationConfig
Sourcepub const fn new(sampling: ResolvedGenerationConfig) -> Self
pub const fn new(sampling: ResolvedGenerationConfig) -> Self
Uses resolved checkpoint/request sampling with deterministic seed zero.
Sourcepub const fn with_seed(self, seed: u64) -> Self
pub const fn with_seed(self, seed: u64) -> Self
Selects the deterministic root seed used by a stochastic backend.
Sourcepub fn with_mirostat_v2(
self,
tau: f32,
eta: f32,
) -> Result<Self, GenerationError>
pub fn with_mirostat_v2( self, tau: f32, eta: f32, ) -> Result<Self, GenerationError>
Selects adaptive Mirostat V2 sampling.
Sourcepub const fn sampling(&self) -> ResolvedGenerationConfig
pub const fn sampling(&self) -> ResolvedGenerationConfig
Returns the validated sampling configuration.
Sourcepub const fn strategy(&self) -> TextSamplingStrategy
pub const fn strategy(&self) -> TextSamplingStrategy
Returns the selected backend-neutral sampling strategy.
Trait Implementations§
Source§impl Clone for TextGenerationConfig
impl Clone for TextGenerationConfig
Source§fn clone(&self) -> TextGenerationConfig
fn clone(&self) -> TextGenerationConfig
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 TextGenerationConfig
Source§impl Debug for TextGenerationConfig
impl Debug for TextGenerationConfig
Source§impl PartialEq for TextGenerationConfig
impl PartialEq for TextGenerationConfig
impl StructuralPartialEq for TextGenerationConfig
Auto Trait Implementations§
impl Freeze for TextGenerationConfig
impl RefUnwindSafe for TextGenerationConfig
impl Send for TextGenerationConfig
impl Sync for TextGenerationConfig
impl Unpin for TextGenerationConfig
impl UnsafeUnpin for TextGenerationConfig
impl UnwindSafe for TextGenerationConfig
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