pub struct WhisperConfig {
pub num_mel_bins: usize,
pub max_source_positions: usize,
pub d_model: usize,
pub encoder_attention_heads: usize,
pub encoder_layers: usize,
pub vocab_size: usize,
pub max_target_positions: usize,
pub decoder_attention_heads: usize,
pub decoder_layers: usize,
pub suppress_tokens: Vec<u32>,
pub begin_suppress_tokens: Vec<u32>,
}Expand description
Whisper model dimensions (HF field names; see OpenAI model.py comments in candle).
Fields§
§num_mel_bins: usize§max_source_positions: usize§d_model: usize§encoder_attention_heads: usize§encoder_layers: usize§vocab_size: usize§max_target_positions: usize§decoder_attention_heads: usize§decoder_layers: usize§suppress_tokens: Vec<u32>§begin_suppress_tokens: Vec<u32>Suppressed on the first generated token only (HF begin_suppress_tokens).
Implementations§
Source§impl WhisperConfig
impl WhisperConfig
pub fn from_file(path: &Path) -> Result<WhisperConfig, Error>
pub fn head_dim(&self) -> usize
pub fn decoder_head_dim(&self) -> usize
Sourcepub fn encoder_seq_len(&self, mel_frames: usize) -> usize
pub fn encoder_seq_len(&self, mel_frames: usize) -> usize
Encoder sequence length after the two conv layers (stride-2 on the second).
Sourcepub fn tiny_synthetic() -> WhisperConfig
pub fn tiny_synthetic() -> WhisperConfig
Tiny config for compile tests (no real weights required).
Sourcepub fn tiny() -> WhisperConfig
pub fn tiny() -> WhisperConfig
openai/whisper-tiny dimensions.
Trait Implementations§
Source§impl Clone for WhisperConfig
impl Clone for WhisperConfig
Source§fn clone(&self) -> WhisperConfig
fn clone(&self) -> WhisperConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WhisperConfig
impl Debug for WhisperConfig
Source§impl<'de> Deserialize<'de> for WhisperConfig
impl<'de> Deserialize<'de> for WhisperConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<WhisperConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WhisperConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for WhisperConfig
impl RefUnwindSafe for WhisperConfig
impl Send for WhisperConfig
impl Sync for WhisperConfig
impl Unpin for WhisperConfig
impl UnsafeUnpin for WhisperConfig
impl UnwindSafe for WhisperConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more