pub struct GenerationConfig {
pub max_new_tokens: usize,
pub do_sample: bool,
pub temperature: f32,
pub top_k: Option<usize>,
pub top_p: Option<f32>,
pub eos_token_id: Option<usize>,
pub seed: u64,
}Fields§
§max_new_tokens: usize§do_sample: bool§temperature: f32§top_k: Option<usize>§top_p: Option<f32>§eos_token_id: Option<usize>§seed: u64Implementations§
Source§impl GenerationConfig
impl GenerationConfig
pub fn new(max_new_tokens: usize) -> Self
pub fn with_do_sample(self, do_sample: bool) -> Self
pub fn with_temperature(self, temperature: f32) -> Self
pub fn with_top_k(self, top_k: Option<usize>) -> Self
pub fn with_top_p(self, top_p: Option<f32>) -> Self
pub fn with_eos_token_id(self, eos_token_id: Option<usize>) -> Self
pub fn with_seed(self, seed: u64) -> Self
pub fn validate(&self) -> Result<(), GenerationError>
Trait Implementations§
Source§impl Clone for GenerationConfig
impl Clone for GenerationConfig
Source§fn clone(&self) -> GenerationConfig
fn clone(&self) -> GenerationConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 GenerationConfig
impl Debug for GenerationConfig
Source§impl<'de> Deserialize<'de> for GenerationConfig
impl<'de> Deserialize<'de> for GenerationConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for GenerationConfig
impl PartialEq for GenerationConfig
Source§impl Serialize for GenerationConfig
impl Serialize for GenerationConfig
impl StructuralPartialEq for GenerationConfig
Auto Trait Implementations§
impl Freeze for GenerationConfig
impl RefUnwindSafe for GenerationConfig
impl Send for GenerationConfig
impl Sync for GenerationConfig
impl Unpin for GenerationConfig
impl UnsafeUnpin for GenerationConfig
impl UnwindSafe for GenerationConfig
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