espnet2.asr.frontend.whisper.WhisperFrontend
espnet2.asr.frontend.whisper.WhisperFrontend
class espnet2.asr.frontend.whisper.WhisperFrontend(whisper_model: str = 'small', fs: int | str = 16000, freeze_weights: bool = True, download_dir: str | None = None)
Bases: AbsFrontend
Speech Representation Using Encoder Outputs from OpenAI’s Whisper Model:
URL: https://github.com/openai/whisper
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(input: Tensor, input_lengths: Tensor) → Tuple[Tensor, Tensor]
Defines the computation performed at every call.
Should be overridden by all subclasses.
NOTE
Although the recipe for forward pass needs to be defined within this function, one should call the Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
log_mel_spectrogram(audio: Tensor, ilens: Tensor | None = None) → Tensor
output_size() → int
whisper_encode(input: Tensor, ilens: Tensor | None = None) → Tensor