pub struct GenerationParameters { /* private fields */ }
Expand description
Parameters to use when generating text.
Implementations§
source§impl GenerationParameters
impl GenerationParameters
sourcepub fn sampler(self) -> SamplerChain
pub fn sampler(self) -> SamplerChain
Create a sampler chain from the generation parameters.
sourcepub fn mirostat2_sampler(self) -> SampleMirostat2
pub fn mirostat2_sampler(self) -> SampleMirostat2
Get the mirostat2 sampler from the generation parameters.
sourcepub fn bias_only_sampler(self) -> SamplerChain
pub fn bias_only_sampler(self) -> SamplerChain
Create a sampler chain from the generation parameters without removing any tokens. This can be useful in combination with ModelExt::stream_structured_text_with_sampler
which may pick unlikely tokens.
sourcepub fn with_temperature(self, temperature: f32) -> Self
pub fn with_temperature(self, temperature: f32) -> Self
Set the temperature to use when generating text.
sourcepub fn with_repetition_penalty(self, repetition_penalty: f32) -> Self
pub fn with_repetition_penalty(self, repetition_penalty: f32) -> Self
Set the repetition penalty to use when generating text.
sourcepub fn with_repetition_penalty_range(
self,
repetition_penalty_range: u32
) -> Self
pub fn with_repetition_penalty_range( self, repetition_penalty_range: u32 ) -> Self
Set the repetition penalty range to use when generating text.
sourcepub fn with_max_length(self, max_length: u32) -> Self
pub fn with_max_length(self, max_length: u32) -> Self
Set the maximum length to use when generating text.
sourcepub fn with_stop_on(self, stop_on: impl Into<Option<String>>) -> Self
pub fn with_stop_on(self, stop_on: impl Into<Option<String>>) -> Self
Set the string to stop on when generating text.
sourcepub fn temperature(&self) -> f32
pub fn temperature(&self) -> f32
Get the temperature to use when generating text.
sourcepub fn repetition_penalty(&self) -> f32
pub fn repetition_penalty(&self) -> f32
Get the repetition penalty to use when generating text.
sourcepub fn repetition_penalty_range(&self) -> u32
pub fn repetition_penalty_range(&self) -> u32
Get the repetition penalty range to use when generating text.
sourcepub fn max_length(&self) -> u32
pub fn max_length(&self) -> u32
Get the maximum length to use when generating text.
Trait Implementations§
source§impl Clone for GenerationParameters
impl Clone for GenerationParameters
source§fn clone(&self) -> GenerationParameters
fn clone(&self) -> GenerationParameters
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for GenerationParameters
impl Debug for GenerationParameters
source§impl Default for GenerationParameters
impl Default for GenerationParameters
source§impl PartialEq for GenerationParameters
impl PartialEq for GenerationParameters
source§fn eq(&self, other: &GenerationParameters) -> bool
fn eq(&self, other: &GenerationParameters) -> bool
self
and other
values to be equal, and is used
by ==
.