pub struct AudioTokenizer {
pub cfg: TokenizerConfig,
/* private fields */
}Expand description
The MiMo audio tokenizer encoder and its residual VQ.
Fields§
§cfg: TokenizerConfigImplementations§
Source§impl AudioTokenizer
impl AudioTokenizer
Sourcepub fn features(
&self,
mel: &[f32],
m: usize,
pool: Option<&Pool>,
) -> Result<Vec<f32>, String>
pub fn features( &self, mel: &[f32], m: usize, pool: Option<&Pool>, ) -> Result<Vec<f32>, String>
Pre-RVQ features of ONE segment of m mel frames (mel [m][n_mels]):
rows [⌈⌈m/2⌉/2⌉][d] after down_sample_norm.
Sourcepub fn quantize(
&self,
feats: &[f32],
rows: usize,
bf16_books: bool,
pool: Option<&Pool>,
) -> Vec<u32>
pub fn quantize( &self, feats: &[f32], rows: usize, bf16_books: bool, pool: Option<&Pool>, ) -> Vec<u32>
Residual VQ in f32: per level, the nearest codeword by
‖E‖² − 2 r·E (the row’s ‖r‖² does not move the argmin), then
r −= E[idx]. bf16_books selects the bf16-rounded codebooks a
bf16 serving load holds. Returns [rows][levels].
Auto Trait Implementations§
impl Freeze for AudioTokenizer
impl RefUnwindSafe for AudioTokenizer
impl Send for AudioTokenizer
impl Sync for AudioTokenizer
impl Unpin for AudioTokenizer
impl UnsafeUnpin for AudioTokenizer
impl UnwindSafe for AudioTokenizer
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