1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Whisper Component Blocks: the model, its configs, and the conventions
//! a checkpoint is read under.
//!
//! [`WhisperApiConfig`] describes a model as upstream's `ModelDimensions`
//! does, and lowers through
//! [`ToStructureConfig`](crate::burner::module::ToStructureConfig)
//! to a [`WhisperStructureConfig`] (an [`AudioEncoderConfig`] and a
//! [`TextDecoderConfig`]), which
//! [`ModuleInit`](crate::burner::module::ModuleInit) builds into a [`Whisper`].
//! Both answer [`WhisperMeta`]. [`WhisperGeometry`] is the comparable core of
//! an API config: what a checkpoint fixes, and what a prefab promises.
//!
//! A checkpoint records its weights, and through their shapes the geometry;
//! it does not record the conventions it was trained under. Two configs on
//! the model declare them, defaulting to upstream's:
//! [`WhisperFrontEndConfig`], the audio front end (rate, mel grid, clamp
//! range), and [`WhisperTokenLayoutConfig`], the token layout (languages,
//! base vocabularies, spellings, timestamp grid). Everything the driver
//! derives in samples or ids comes from those two, not from constants.
//!
//! The text decoder's incremental decode keeps its state in a
//! [`KVCache`](crate::ops::transformers::attention::KVCache) the caller opens
//! per decode ([`TextDecoder::new_cache`]), never on the model.
/// Default Whisper Head Dimensionality.
pub const WHISPER_DEFAULT_D_MODEL: usize = 64;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;