bunsen 0.42.0

bunsen is a batteries included common library for burn
Documentation
//! # Voxtral Realtime
//!
//! Mistral's Voxtral Realtime speech recognizer
//! (`mistralai/Voxtral-Mini-4B-Realtime-2602`): a causal audio encoder whose
//! frames are added, one group per 80 ms, to the token embeddings of a
//! Mistral text model that writes the transcript a fixed delay behind the
//! audio. Every part is causal, so the model streams natively: each 80 ms of
//! audio is one decoder step.
//!
//! - [`blocks`]: the model, [`VoxtralRealtime`], built from a
//!   [`VoxtralRealtimeConfig`]: a
//!   [`VoxtralAudioEncoder`](blocks::VoxtralAudioEncoder) and a
//!   [`VoxtralTextModel`](blocks::VoxtralTextModel) on the shared
//!   [`CausalDecoderBlock`](crate::blocks::transformers::decoders::causal::CausalDecoderBlock),
//!   and a [`VoxtralProjector`](blocks::VoxtralProjector) between them.
//! - [`VoxtralFrontEnd`]: the feature extractor, Whisper's log-mels under a
//!   fixed level.
//! - [`VoxtralTokenLayout`]: the stream's special tokens, its delay (480 ms by
//!   default; any multiple of 80 ms up to 1200, or 2400), the padding around an
//!   utterance, and the prompt.
//! - [`VoxtralGreedyDecoder`]: greedy decoding through a KV cache, one id per
//!   position, each position's audio added to its token
//!   ([`VoxtralDecodeStep`]).
//! - [`VoxtralTranscript`]: a decode's ids as timed [`VoxtralWord`]s and text.
//! - [`VoxtralConstruct`]: a model with its front end, vocabulary
//!   ([`TekkenVocabulary`](crate::kits::support::tokens::TekkenVocabulary)),
//!   layout and decoder; [`transcribe`](VoxtralConstruct::transcribe) one
//!   utterance.
//! - [`driver`]: [`VoxtralEngine`](driver::VoxtralEngine), a construct as the
//!   [`asr_driver`](crate::kits::speech::asr::driver) core's engine, each
//!   window decoded whole and laid out a segment per timed word; a
//!   [`VoxtralStreamDriver`](driver::VoxtralStreamDriver) streams audio through
//!   it, under any
//!   [`EmissionPolicy`](crate::kits::speech::asr::driver::EmissionPolicy).
//! - [`pretrained`] (features `store` and `cache`): the named checkpoint,
//!   `mistralai/voxtral-mini-4b-realtime-2602` the default, `hf:` repos, and
//!   the factory that loads one into a construct.
//! - [`weights`] (feature `store`): loading tensors named as the published
//!   `model.safetensors` names them, and reading its `config.json`.

pub mod blocks;
pub mod driver;

mod construct;
mod decode;
mod front_end;
mod layout;
mod transcript;
pub use construct::*;
pub use decode::*;
pub use front_end::*;
pub use layout::*;
pub use transcript::*;

#[cfg(feature = "store")]
pub mod pretrained;

#[cfg(feature = "store")]
pub mod weights;

#[cfg(all(test, feature = "store"))]
mod toy_tests;

#[doc(inline)]
pub use blocks::{
    VoxtralRealtime,
    VoxtralRealtimeConfig,
};