Skip to main content

MimoAudio

Struct MimoAudio 

Source
pub struct MimoAudio {
    pub tokenizer: AudioTokenizer,
    pub encoder: AudioEncoder,
    pub bf16_codebooks: bool,
    /* private fields */
}
Expand description

The MiMo audio towers.

Fields§

§tokenizer: AudioTokenizer§encoder: AudioEncoder§bf16_codebooks: bool

Quantize against bf16-rounded codebooks, as the bf16 serving stacks do (default on; CMF_MIMO_AUDIO_BF16_BOOKS=0 turns it off).

Implementations§

Source§

impl MimoAudio

Source

pub fn present_in(model: &CmfModel) -> bool

Whether a CMF carries the audio towers (a companion or a single-file multimodal container).

Source

pub fn from_model(model: &Arc<CmfModel>) -> Result<Self, String>

Load from a CMF holding the source tensor names (the <stem>.mm.cmf companion or a single-file multimodal container).

Source

pub fn from_hf_dir(dir: &Path) -> Result<Self, String>

Development loader: read the tensors straight from the HF checkpoint directory (config.json, model.safetensors.index.json and its shards, audio_tokenizer/), exact f32 from BF16.

Source

pub fn pool(&self) -> Option<&Pool>

Source

pub fn wav_to_mel(&self, bytes: &[u8]) -> Result<(Vec<f32>, usize), String>

WAV bytes → 24 kHz mono → log-mel [M][128].

Source

pub fn features(&self, mel: &[f32], m: usize) -> Result<Vec<f32>, String>

Pre-RVQ features of every segment, concatenated [codes][d].

Source

pub fn encode_mel(&self, mel: &[f32], m: usize) -> Result<AudioCodes, String>

Log-mel → tokenizer codes, each 6000-frame segment on its own.

Source

pub fn embed_codes(&self, codes: &AudioCodes) -> Result<AudioEmbeds, String>

Codes → LLM embedding rows.

Source

pub fn embed_wav(&self, bytes: &[u8]) -> Result<AudioEmbeds, String>

WAV bytes → LLM embedding rows (one per <|audio_pad|>).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more