Struct candle_lora::LoraEmbedding
source · pub struct LoraEmbedding { /* private fields */ }
Implementations§
source§impl LoraEmbedding
impl LoraEmbedding
pub fn new( old: &dyn EmbeddingLayerLike, embed_config: &LoraEmbeddingConfig, config: &LoraConfig, vb: &VarBuilder<'_>, id: usize, ) -> Result<Self>
Trait Implementations§
source§impl Clone for LoraEmbedding
impl Clone for LoraEmbedding
source§fn clone(&self) -> LoraEmbedding
fn clone(&self) -> LoraEmbedding
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LoraEmbedding
impl Debug for LoraEmbedding
source§impl EmbeddingLayerLike for LoraEmbedding
impl EmbeddingLayerLike for LoraEmbedding
fn embeddings(&self) -> &Tensor
source§impl Merge for LoraEmbedding
impl Merge for LoraEmbedding
source§fn get_delta_weight(&self) -> Result<Tensor, MergeErrorOrError>
fn get_delta_weight(&self) -> Result<Tensor, MergeErrorOrError>
Get the delta weight of the LoRA layer. This is meant to be an internal method.
source§fn merge_weights(&mut self) -> Result<(), MergeErrorOrError>
fn merge_weights(&mut self) -> Result<(), MergeErrorOrError>
Merge the LoRA weights.
source§fn unmerge_weights(&mut self) -> Result<(), MergeErrorOrError>
fn unmerge_weights(&mut self) -> Result<(), MergeErrorOrError>
Unmerge the LoRA weights.
source§impl Saveable for LoraEmbedding
impl Saveable for LoraEmbedding
fn get_tensors(&self, accum: &mut HashMap<String, Tensor>)
Auto Trait Implementations§
impl Freeze for LoraEmbedding
impl !RefUnwindSafe for LoraEmbedding
impl Send for LoraEmbedding
impl Sync for LoraEmbedding
impl Unpin for LoraEmbedding
impl !UnwindSafe for LoraEmbedding
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