pub struct LoraAdapter {
pub layer_id: u32,
pub matrix: String,
pub rank: u32,
pub in_dim: u32,
pub out_dim: u32,
pub a: Vec<f32>,
pub b: Vec<f32>,
}Expand description
One LoRA adapter for one matrix in one layer.
Fields§
§layer_id: u32Layer index.
matrix: StringWhich matrix this adapter targets (e.g. "q_proj", "v_proj").
rank: u32Adapter rank (= shared inner dim of A and B).
in_dim: u32Input dimension (= columns of A, rows of the original matrix).
out_dim: u32Output dimension (= rows of B, rows of the original matrix).
a: Vec<f32>A matrix, shape [rank, in_dim], row-major.
b: Vec<f32>B matrix, shape [out_dim, rank], row-major.
Implementations§
Trait Implementations§
Source§impl Clone for LoraAdapter
impl Clone for LoraAdapter
Source§fn clone(&self) -> LoraAdapter
fn clone(&self) -> LoraAdapter
Returns a duplicate 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 LoraAdapter
impl Debug for LoraAdapter
Source§impl<'de> Deserialize<'de> for LoraAdapter
impl<'de> Deserialize<'de> for LoraAdapter
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
Source§impl PartialEq for LoraAdapter
impl PartialEq for LoraAdapter
Source§impl Serialize for LoraAdapter
impl Serialize for LoraAdapter
impl StructuralPartialEq for LoraAdapter
Auto Trait Implementations§
impl Freeze for LoraAdapter
impl RefUnwindSafe for LoraAdapter
impl Send for LoraAdapter
impl Sync for LoraAdapter
impl Unpin for LoraAdapter
impl UnsafeUnpin for LoraAdapter
impl UnwindSafe for LoraAdapter
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