pub struct Options {
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub top_k: Option<i32>,
pub num_predict: Option<i32>,
pub stop: Option<Vec<String>>,
pub seed: Option<i64>,
}Expand description
Options for generation.
Fields§
§temperature: Option<f32>Temperature for sampling.
top_p: Option<f32>Top-p sampling.
top_k: Option<i32>Top-k sampling.
num_predict: Option<i32>Number of tokens to predict.
stop: Option<Vec<String>>Stop sequences.
seed: Option<i64>Seed for reproducibility.
Implementations§
Source§impl Options
impl Options
Sourcepub fn with_temperature(self, temperature: f32) -> Self
pub fn with_temperature(self, temperature: f32) -> Self
Create new options with temperature.
Sourcepub fn with_top_p(self, top_p: f32) -> Self
pub fn with_top_p(self, top_p: f32) -> Self
Set top-p sampling.
Sourcepub fn with_num_predict(self, num_predict: i32) -> Self
pub fn with_num_predict(self, num_predict: i32) -> Self
Set number of tokens to predict.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Options
impl<'de> Deserialize<'de> for Options
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
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
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