pub struct SpeechHead {
pub state: WeightState,
}Expand description
Learned speech CTC head. Fail-closed: Absent state or unknown language ⇒ abstain.
Fields§
§state: WeightStateImplementations§
Source§impl SpeechHead
impl SpeechHead
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct with no weights — fails closed until SpeechHead::load succeeds.
Sourcepub fn load(&mut self, bytes: &[u8]) -> Result<(), AudioError>
pub fn load(&mut self, bytes: &[u8]) -> Result<(), AudioError>
Load weights from a P64 blob (cold path).
Sourcepub fn is_ready(&self) -> bool
pub fn is_ready(&self) -> bool
Whether a real forward pass is available (weights present and a known language).
Sourcepub fn infer_ctc(
&self,
logmel: &[f32],
out_tokens: &mut [TranscriptToken],
) -> Result<usize, AudioError>
pub fn infer_ctc( &self, logmel: &[f32], out_tokens: &mut [TranscriptToken], ) -> Result<usize, AudioError>
Greedy-CTC decode logmel (row-major frames × feat_dim) into out_tokens.
- No weights ⇒
Err(BackendUnavailable)(abstain). - Unknown language (
language_slot == 0) ⇒Err(BackendUnavailable)(no silent map). logmel.len()must be a whole multiple offeat_dim, elseInvalidParameter.- If more tokens survive collapse than
out_tokenscan hold ⇒OutputBufferTooSmall.
Returns the number of tokens written. Hot path: no allocation.
Trait Implementations§
Source§impl Debug for SpeechHead
impl Debug for SpeechHead
Auto Trait Implementations§
impl Freeze for SpeechHead
impl RefUnwindSafe for SpeechHead
impl Send for SpeechHead
impl Sync for SpeechHead
impl Unpin for SpeechHead
impl UnsafeUnpin for SpeechHead
impl UnwindSafe for SpeechHead
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