pub struct ConfigBuilder { /* private fields */ }Expand description
Builder for the OxiBonsaiConfig.
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn model_path(self, path: impl Into<String>) -> Self
pub fn model_path(self, path: impl Into<String>) -> Self
Set the path to the GGUF model file.
Sourcepub fn tokenizer_path(self, path: impl Into<String>) -> Self
pub fn tokenizer_path(self, path: impl Into<String>) -> Self
Set the path to the tokenizer.json file.
Sourcepub fn max_seq_len(self, len: usize) -> Self
pub fn max_seq_len(self, len: usize) -> Self
Set the maximum sequence length (prompt + generated).
Sourcepub fn log_level(self, level: impl Into<String>) -> Self
pub fn log_level(self, level: impl Into<String>) -> Self
Set the log level filter (e.g. “info”, “debug”, “warn”).
Sourcepub fn temperature(self, t: f32) -> Self
pub fn temperature(self, t: f32) -> Self
Set the sampling temperature.
Sourcepub fn repetition_penalty(self, rp: f32) -> Self
pub fn repetition_penalty(self, rp: f32) -> Self
Set the repetition penalty.
Sourcepub fn max_tokens(self, n: usize) -> Self
pub fn max_tokens(self, n: usize) -> Self
Set the maximum tokens to generate.
Sourcepub fn build(self) -> RuntimeResult<OxiBonsaiConfig>
pub fn build(self) -> RuntimeResult<OxiBonsaiConfig>
Validate and build the OxiBonsaiConfig.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnsafeUnpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more