pub struct Lfm2ModelBuilder<'a> { /* private fields */ }Expand description
Builds an Lfm2Model from loaded weights.
Implementations§
Source§impl<'a> Lfm2ModelBuilder<'a>
impl<'a> Lfm2ModelBuilder<'a>
Sourcepub fn new(
ctx: Arc<WgpuContext>,
engine: Arc<ComputeEngine>,
weights: &'a WeightsContext,
config: Lfm2Config,
) -> Self
pub fn new( ctx: Arc<WgpuContext>, engine: Arc<ComputeEngine>, weights: &'a WeightsContext, config: Lfm2Config, ) -> Self
A builder for config reading tensors from weights.
Sourcepub fn with_lora(self, lora_config: LoRaConfig) -> Self
pub fn with_lora(self, lora_config: LoRaConfig) -> Self
Attach LoRA adapters to the projections named in lora_config.
Sourcepub fn with_trainable_base(self, trainable: bool) -> Self
pub fn with_trainable_base(self, trainable: bool) -> Self
Let the base weights receive gradients (full or partial fine-tuning). By default they are frozen and only LoRA adapters train.
Sourcepub fn build(self) -> Result<Lfm2Model, BuildError>
pub fn build(self) -> Result<Lfm2Model, BuildError>
Build the complete model, or explain which weight or setting is missing or unsupported.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Lfm2ModelBuilder<'a>
impl<'a> !UnwindSafe for Lfm2ModelBuilder<'a>
impl<'a> Freeze for Lfm2ModelBuilder<'a>
impl<'a> Send for Lfm2ModelBuilder<'a>
impl<'a> Sync for Lfm2ModelBuilder<'a>
impl<'a> Unpin for Lfm2ModelBuilder<'a>
impl<'a> UnsafeUnpin for Lfm2ModelBuilder<'a>
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> 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