pub struct MimiConfig {Show 28 fields
pub audio_channels: usize,
pub num_filters: usize,
pub kernel_size: usize,
pub last_kernel_size: usize,
pub hidden_size: usize,
pub upsampling_ratios: Vec<usize>,
pub num_residual_layers: usize,
pub residual_kernel_size: usize,
pub dilation_growth_rate: usize,
pub compress: usize,
pub codebook_dim: usize,
pub codebook_size: usize,
pub num_quantizers: usize,
pub num_semantic_quantizers: usize,
pub vector_quantization_hidden_dimension: usize,
pub upsample_groups: usize,
pub num_hidden_layers: usize,
pub intermediate_size: usize,
pub num_attention_heads: usize,
pub num_key_value_heads: usize,
pub head_dim: usize,
pub sliding_window: usize,
pub norm_eps: f32,
pub rope_theta: f64,
pub layer_scale_initial_scale: f32,
pub sampling_rate: u32,
pub frame_rate: f32,
pub trim_right_ratio: f32,
}Expand description
Flat HF config.json for kyutai/mimi.
Fields§
§audio_channels: usize§num_filters: usize§kernel_size: usize§last_kernel_size: usize§upsampling_ratios: Vec<usize>§num_residual_layers: usize§residual_kernel_size: usize§dilation_growth_rate: usize§compress: usize§codebook_dim: usize§codebook_size: usize§num_quantizers: usize§num_semantic_quantizers: usize§upsample_groups: usize§intermediate_size: usize§num_attention_heads: usize§num_key_value_heads: usize§head_dim: usize§sliding_window: usize§norm_eps: f32§rope_theta: f64§layer_scale_initial_scale: f32§sampling_rate: u32§frame_rate: f32§trim_right_ratio: f32Implementations§
Source§impl MimiConfig
impl MimiConfig
pub fn load(model_dir: &Path) -> Result<MimiConfig, Error>
Sourcepub fn seanet_hop(&self) -> usize
pub fn seanet_hop(&self) -> usize
SEANet hop length before the stride-2 frame-rate downsample.
Sourcepub fn samples_per_codec_frame(&self) -> usize
pub fn samples_per_codec_frame(&self) -> usize
PCM samples per one codec frame @ Self::frame_rate Hz.
Sourcepub fn encoded_frame_count(&self, pcm_len: usize) -> usize
pub fn encoded_frame_count(&self, pcm_len: usize) -> usize
Approximate encoded frame count for pcm_len samples (matches HF get_encoded_length).
pub fn num_acoustic_quantizers(&self) -> usize
Sourcepub fn bitrate_bps(&self) -> f32
pub fn bitrate_bps(&self) -> f32
Nominal bitrate in bits per second (codebooks × log2(codebook_size) × frame_rate).
Sourcepub fn frame_rate_kernel(&self) -> usize
pub fn frame_rate_kernel(&self) -> usize
Kernel size for the frame-rate downsample / upsample convs.
Trait Implementations§
Source§impl Clone for MimiConfig
impl Clone for MimiConfig
Source§fn clone(&self) -> MimiConfig
fn clone(&self) -> MimiConfig
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 MimiConfig
impl Debug for MimiConfig
Source§impl<'de> Deserialize<'de> for MimiConfig
impl<'de> Deserialize<'de> for MimiConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MimiConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MimiConfig, <__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 MimiConfig
impl RefUnwindSafe for MimiConfig
impl Send for MimiConfig
impl Sync for MimiConfig
impl Unpin for MimiConfig
impl UnsafeUnpin for MimiConfig
impl UnwindSafe for MimiConfig
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>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 more