pub struct LLaMAConfig {
pub vocab_size: usize,
pub hidden_size: usize,
pub intermediate_size: usize,
pub num_layers: usize,
pub num_attention_heads: usize,
pub num_key_value_heads: usize,
pub max_position_embeddings: usize,
pub rms_norm_eps: f32,
pub rope_theta: f32,
}Expand description
LLaMA configuration
Fields§
§vocab_size: usizeVocabulary size
Hidden size
intermediate_size: usizeIntermediate size (FFN)
num_layers: usizeNumber of layers
num_attention_heads: usizeNumber of attention heads
num_key_value_heads: usizeNumber of key-value heads (for GQA)
max_position_embeddings: usizeMaximum sequence length
rms_norm_eps: f32RMS norm epsilon
rope_theta: f32RoPE theta
Implementations§
Source§impl LLaMAConfig
impl LLaMAConfig
Sourcepub fn llama2_13b() -> Self
pub fn llama2_13b() -> Self
LLaMA 2 13B
Sourcepub fn llama2_70b() -> Self
pub fn llama2_70b() -> Self
LLaMA 2 70B
Sourcepub fn llama_tiny() -> Self
pub fn llama_tiny() -> Self
Tiny LLaMA for testing
Trait Implementations§
Source§impl Clone for LLaMAConfig
impl Clone for LLaMAConfig
Source§fn clone(&self) -> LLaMAConfig
fn clone(&self) -> LLaMAConfig
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 LLaMAConfig
impl Debug for LLaMAConfig
Auto Trait Implementations§
impl Freeze for LLaMAConfig
impl RefUnwindSafe for LLaMAConfig
impl Send for LLaMAConfig
impl Sync for LLaMAConfig
impl Unpin for LLaMAConfig
impl UnwindSafe for LLaMAConfig
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