pub struct GemmaConfig {Show 22 fields
pub arch: GemmaArch,
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 tie_word_embeddings: bool,
pub attention_bias: bool,
pub head_dim: Option<usize>,
pub attn_logit_softcapping: Option<f32>,
pub final_logit_softcapping: Option<f32>,
pub sliding_window: Option<usize>,
pub query_pre_attn_scalar: Option<f32>,
pub effective_num_layers: Option<usize>,
pub num_experts: usize,
pub num_experts_used: usize,
pub expert_ffn_size: usize,
pub expert_weights_scale: f32,
}Fields§
§arch: GemmaArch§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>§attn_logit_softcapping: Option<f32>§final_logit_softcapping: Option<f32>§sliding_window: Option<usize>§query_pre_attn_scalar: Option<f32>§effective_num_layers: Option<usize>§num_experts: usize§num_experts_used: usize§expert_ffn_size: usize§expert_weights_scale: f32Implementations§
Source§impl GemmaConfig
impl GemmaConfig
pub fn from_file(path: &Path) -> Result<GemmaConfig, Error>
pub fn from_gguf(raw: &GgufFile) -> Result<GemmaConfig, 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
pub fn layer_style(&self) -> GemmaLayerStyle
pub fn active_num_layers(&self) -> usize
pub fn is_moe(&self) -> bool
pub fn expert_ffn_dim(&self) -> usize
pub fn attn_score_scale(&self) -> Option<f32>
pub fn layer_attn_options( &self, layer: usize, ) -> (MaskKind, Option<f32>, Option<f32>)
Trait Implementations§
Source§impl Clone for GemmaConfig
impl Clone for GemmaConfig
Source§fn clone(&self) -> GemmaConfig
fn clone(&self) -> GemmaConfig
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 GemmaConfig
impl Debug for GemmaConfig
Source§impl<'de> Deserialize<'de> for GemmaConfig
impl<'de> Deserialize<'de> for GemmaConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GemmaConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GemmaConfig, <__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 GemmaConfig
impl RefUnwindSafe for GemmaConfig
impl Send for GemmaConfig
impl Sync for GemmaConfig
impl Unpin for GemmaConfig
impl UnsafeUnpin for GemmaConfig
impl UnwindSafe for GemmaConfig
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