pub struct QueryKeyRotaryEmbeddingsConfig { /* private fields */ }Expand description
Configuration for query-key rotary embeddings.
Implementations§
Source§impl QueryKeyRotaryEmbeddingsConfig
impl QueryKeyRotaryEmbeddingsConfig
Sourcepub fn build(
&self,
vb: VarBuilder<'_>,
) -> Result<QueryKeyRotaryEmbeddings, QueryKeyRotaryEmbeddingsError>
pub fn build( &self, vb: VarBuilder<'_>, ) -> Result<QueryKeyRotaryEmbeddings, QueryKeyRotaryEmbeddingsError>
Build query-key rotary embeddings
Sourcepub fn base(self, base: usize) -> Self
pub fn base(self, base: usize) -> Self
Base used for theta.
This determines the cycle length of the embeddings.
Default: 10_000
Sourcepub fn fraction(self, fraction: f32) -> Self
pub fn fraction(self, fraction: f32) -> Self
Fraction of the hidden width to apply rotary embeddings to.
Must be in [0,1].
Default: 1.0
Sourcepub fn head_width(self, head_width: usize) -> Self
pub fn head_width(self, head_width: usize) -> Self
Head width for query and key attention.
Default: 96
Trait Implementations§
Source§impl Clone for QueryKeyRotaryEmbeddingsConfig
impl Clone for QueryKeyRotaryEmbeddingsConfig
Source§fn clone(&self) -> QueryKeyRotaryEmbeddingsConfig
fn clone(&self) -> QueryKeyRotaryEmbeddingsConfig
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 moreAuto Trait Implementations§
impl Freeze for QueryKeyRotaryEmbeddingsConfig
impl RefUnwindSafe for QueryKeyRotaryEmbeddingsConfig
impl Send for QueryKeyRotaryEmbeddingsConfig
impl Sync for QueryKeyRotaryEmbeddingsConfig
impl Unpin for QueryKeyRotaryEmbeddingsConfig
impl UnwindSafe for QueryKeyRotaryEmbeddingsConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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