pub struct ModelDef {
pub name: String,
pub description: Option<String>,
pub vocab_size: usize,
pub max_seq_len: usize,
pub hidden_size: usize,
pub num_layers: usize,
pub block: BlockDef,
pub embeddings: EmbeddingsConfig,
pub output: OutputConfig,
}Expand description
Parsed model definition from MAL
Fields§
§name: String§description: Option<String>§vocab_size: usize§max_seq_len: usize§num_layers: usize§block: BlockDef§embeddings: EmbeddingsConfig§output: OutputConfigImplementations§
Source§impl ModelDef
impl ModelDef
pub fn num_heads(&self) -> usize
pub fn num_kv_heads(&self) -> usize
pub fn head_dim(&self) -> usize
pub fn intermediate_size(&self) -> usize
pub fn dropout(&self) -> f64
pub fn use_bias(&self) -> bool
pub fn norm_eps(&self) -> f64
pub fn rope_theta(&self) -> f64
pub fn use_swiglu(&self) -> bool
pub fn use_rmsnorm(&self) -> bool
Sourcepub fn estimated_params(&self) -> usize
pub fn estimated_params(&self) -> usize
Estimate total parameters
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ModelDef
impl<'de> Deserialize<'de> for ModelDef
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 ModelDef
impl RefUnwindSafe for ModelDef
impl Send for ModelDef
impl Sync for ModelDef
impl Unpin for ModelDef
impl UnsafeUnpin for ModelDef
impl UnwindSafe for ModelDef
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more