pub struct Options { /* private fields */ }
Expand description
A collection of options that can be used to configure a model.
Options
is the struct that represents a set of options for a large language model.
It provides methods for creating, adding, and retrieving options.
The ‘Options’ struct is mainly created using the OptionsBuilder
to allow for
flexibility in setting options.
Implementations§
Source§impl Options
impl Options
Sourcepub fn builder() -> OptionsBuilder
pub fn builder() -> OptionsBuilder
Sourcepub fn get(&self, opt_discriminant: OptDiscriminants) -> Option<&Opt>
pub fn get(&self, opt_discriminant: OptDiscriminants) -> Option<&Opt>
Gets the value of an option from this set of options.
This function finds the first option in opts
that matches the provided OptDiscriminants
.
§Arguments
opt_discriminant
- AnOptDiscriminants
value representing the discriminant of the desiredOpt
.
§Returns
An Option
that contains a reference to the Opt
if found, or None
if not found.
§Example
let mut builder = Options::builder();
builder.add_option(Opt::Model(ModelRef::from_path("path_to_model")));
let options = builder.build();
let model_option = options.get(OptDiscriminants::Model);
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