pub struct ModelConfig {Show 14 fields
pub dim: usize,
pub n_layers: usize,
pub head_dim: usize,
pub input_dim: usize,
pub encoder_output_dim: usize,
pub encoder_latent_downsample_factor: usize,
pub t_dim: usize,
pub max_seqlen: usize,
pub rope_dim: usize,
pub rope_theta: f64,
pub norm_eps: f64,
pub ffn_dim_multiplier: Option<f64>,
pub multiple_of: usize,
pub stft_global_sigma: f64,
}Expand description
Model and runtime configuration for ZUNA inference.
ModelConfig is deserialised from the HuggingFace config.json
(the "model" sub-object). Field names must match exactly.
Fields§
§dim: usize§n_layers: usize§head_dim: usize§input_dim: usize§encoder_output_dim: usize§encoder_latent_downsample_factor: usize§t_dim: usize§max_seqlen: usize§rope_dim: usize§rope_theta: f64§norm_eps: f64§ffn_dim_multiplier: Option<f64>§multiple_of: usize§stft_global_sigma: f64Implementations§
Source§impl ModelConfig
impl ModelConfig
Sourcepub fn n_heads_fallback(&self) -> usize
pub fn n_heads_fallback(&self) -> usize
n_heads is NOT dim/head_dim for this checkpoint.
It must be inferred from the wq weight shape at load time.
Use WeightMap::infer_n_heads() instead of calling this.
Feed-forward hidden dim (matches Python FeedForward.init): hidden = int(2 * 4 * dim / 3) → 2730 hidden = 256 * ceil(2730 / 256) → 2816
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 · 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
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