pub struct CodePredictor { /* private fields */ }Expand description
The code predictor: a Qwen3 decoder over a frame’s slots
[talker hidden, code 0, code 1 …], each step one more code. Its layers
run as a pipeline of their own — the file opened again as a five-layer
Qwen3 (CmfModel::open_view) — so they reach the same device graphs as
the talker; its per-codebook embeddings and heads stay on the host.
Implementations§
Source§impl CodePredictor
impl CodePredictor
pub fn from_model( model: &CmfModel, c: &Qwen3TtsConfig, pool: Option<Arc<Pool>>, ) -> Result<Self, String>
Sourcepub fn code_row(&self, g: usize, code: u32) -> &[f32]
pub fn code_row(&self, g: usize, code: u32) -> &[f32]
Codebook g’s embedding row of code (g in 1..groups).
Sourcepub fn frame(
&mut self,
talker_h: &[f32],
code0_row: &[f32],
s: &Sampling,
rng: &mut SplitMix64,
) -> Result<Vec<u32>, String>
pub fn frame( &mut self, talker_h: &[f32], code0_row: &[f32], s: &Sampling, rng: &mut SplitMix64, ) -> Result<Vec<u32>, String>
The other codebooks of a frame: talker_h (the talker’s
final-normed state) and code0_row (the talker’s embedding of the
first code) are the prefix; each step reads its own head.
Auto Trait Implementations§
impl !Freeze for CodePredictor
impl !RefUnwindSafe for CodePredictor
impl !Sync for CodePredictor
impl !UnwindSafe for CodePredictor
impl Forget for CodePredictor
impl Move for CodePredictor
impl Send for CodePredictor
impl Unpin for CodePredictor
impl UnsafeUnpin for CodePredictor
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