pub struct ModelConfig {Show 20 fields
pub hidden_size: usize,
pub num_layers: usize,
pub num_attention_heads: usize,
pub num_kv_heads: usize,
pub intermediate_size: usize,
pub vocab_size: usize,
pub context_length: usize,
pub rope_theta: f32,
pub head_dim: Option<usize>,
pub layer_types: Option<Vec<String>>,
pub num_kv_shared_layers: Option<usize>,
pub use_double_wide_mlp: Option<bool>,
pub hidden_act: Option<String>,
pub num_experts: Option<usize>,
pub num_experts_per_tok: Option<usize>,
pub tie_word_embeddings: Option<bool>,
pub conv_l_cache: Option<usize>,
pub sliding_window: Option<usize>,
pub partial_rotary_factor: Option<f32>,
pub global_head_dim: Option<usize>,
}Fields§
§num_layers: usize§num_attention_heads: usize§num_kv_heads: usize§intermediate_size: usize§vocab_size: usize§context_length: usize§rope_theta: f32§head_dim: Option<usize>§layer_types: Option<Vec<String>>§use_double_wide_mlp: Option<bool>§num_experts: Option<usize>§num_experts_per_tok: Option<usize>§tie_word_embeddings: Option<bool>§conv_l_cache: Option<usize>LFM2 short-conv kernel / cache length (HF conv_L_cache, default 3).
sliding_window: Option<usize>Sliding-window attention length (HF sliding_window). Required for gemma-4.
partial_rotary_factor: Option<f32>Gemma-4 global p-RoPE fraction (HF partial_rotary_factor). Required for gemma-4.
global_head_dim: Option<usize>Gemma-4 full-attention head dim (HF global_head_dim). Required for gemma-4.
Trait Implementations§
Source§impl Clone for ModelConfig
impl Clone for ModelConfig
Source§fn clone(&self) -> ModelConfig
fn clone(&self) -> ModelConfig
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 ModelConfig
impl Debug for ModelConfig
Source§impl<'de> Deserialize<'de> for ModelConfig
impl<'de> Deserialize<'de> for ModelConfig
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
Auto Trait Implementations§
impl Freeze for ModelConfig
impl RefUnwindSafe for ModelConfig
impl Send for ModelConfig
impl Sync for ModelConfig
impl Unpin for ModelConfig
impl UnsafeUnpin for ModelConfig
impl UnwindSafe for ModelConfig
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