pub struct TotoModelBuilder { /* private fields */ }Expand description
Fluent constructor for TotoModel: point it at a GGUF file, optionally
layer on a parsed config.json and/or explicit InferConfig overrides,
then call build.
use zsfm_toto::infer::TotoModel;
let model = TotoModel::builder("toto.gguf")
.config_json(&serde_json::json!({ "d_model": 2048, "num_layers": 48 }))
.with_compute_f64(true)
.build()?;Implementations§
Source§impl TotoModelBuilder
impl TotoModelBuilder
Sourcepub fn config(self, config: InferConfig) -> Self
pub fn config(self, config: InferConfig) -> Self
Replace the whole config, e.g. one built by hand via
InferConfig::default().with_d_model(...).with_num_layers(...).
Sourcepub fn config_json(self, v: &Value) -> Self
pub fn config_json(self, v: &Value) -> Self
Populate the config from a parsed HuggingFace config.json.
Sourcepub fn with_compute_f64(self, v: bool) -> Self
pub fn with_compute_f64(self, v: bool) -> Self
Run the forward pass in F64 (double precision) to match PyTorch numerical accuracy. Uses ~2× memory. Default: F32.
pub fn build(self) -> Result<TotoModel>
Auto Trait Implementations§
impl Freeze for TotoModelBuilder
impl RefUnwindSafe for TotoModelBuilder
impl Send for TotoModelBuilder
impl Sync for TotoModelBuilder
impl Unpin for TotoModelBuilder
impl UnsafeUnpin for TotoModelBuilder
impl UnwindSafe for TotoModelBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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