pub struct Llama32Config {Show 17 fields
pub vocab_size: usize,
pub hidden_size: usize,
pub intermediate_size: usize,
pub num_hidden_layers: usize,
pub num_attention_heads: usize,
pub num_key_value_heads: usize,
pub max_position_embeddings: usize,
pub rms_norm_eps: f64,
pub rope_theta: f64,
pub hidden_act: String,
pub tie_word_embeddings: bool,
pub attention_bias: bool,
pub head_dim: Option<usize>,
pub rope_scaling: Option<Llama32RopeScaling>,
pub rope_style: RopeStyle,
pub gguf_arch: Option<String>,
pub rope_dim: Option<usize>,
}Fields§
§vocab_size: usize§intermediate_size: usize§num_attention_heads: usize§num_key_value_heads: usize§max_position_embeddings: usize§rms_norm_eps: f64§rope_theta: f64§tie_word_embeddings: bool§attention_bias: bool§head_dim: Option<usize>Explicit head dim (Llama 3.x); when absent, derived from hidden/heads.
rope_scaling: Option<Llama32RopeScaling>§rope_style: RopeStyleRoPE pairing flavor. GGUF Llama weights are permuted by the HF→GGUF
converter for llama.cpp’s interleaved (NORM) RoPE, so GGUF-backed
inference must rotate with rlx_ir::RopeStyle::GptJ; HF-safetensors
checkpoints use rlx_ir::RopeStyle::NeoX (default). Not present in
HF config.json, so skipped during deserialization.
gguf_arch: Option<String>GGUF general.architecture tag when loaded from GGUF (llama, phi3, …).
rope_dim: Option<usize>Rotary dimension when it differs from [head_dim] (Phi-3 partial RoPE).
Implementations§
Source§impl Llama32Config
impl Llama32Config
pub fn from_file(path: &Path) -> Result<Llama32Config, Error>
pub fn from_gguf(raw: &GgufFile) -> Result<Llama32Config, Error>
pub fn head_dim(&self) -> usize
pub fn kv_group_size(&self) -> usize
pub fn q_proj_dim(&self) -> usize
pub fn kv_proj_dim(&self) -> usize
Sourcepub fn n_rot(&self) -> usize
pub fn n_rot(&self) -> usize
Leading per-head dims that receive RoPE (equals [head_dim] for Llama;
may be smaller for Phi-3 partial RoPE).
pub fn uses_partial_rope(&self) -> bool
pub fn is_phi_arch(&self) -> bool
Trait Implementations§
Source§impl Clone for Llama32Config
impl Clone for Llama32Config
Source§fn clone(&self) -> Llama32Config
fn clone(&self) -> Llama32Config
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Llama32Config
impl Debug for Llama32Config
Source§impl<'de> Deserialize<'de> for Llama32Config
impl<'de> Deserialize<'de> for Llama32Config
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Llama32Config, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Llama32Config, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Llama32Config
impl RefUnwindSafe for Llama32Config
impl Send for Llama32Config
impl Sync for Llama32Config
impl Unpin for Llama32Config
impl UnsafeUnpin for Llama32Config
impl UnwindSafe for Llama32Config
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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