Currently, WhisperAudioTranscriber relies exclusively on the vanilla openai-whisper package. While accurate, it runs relatively slow on standard CPU environments and uses a larger VRAM/RAM footprint compared to optimized execution backends.
I would like to propose adding faster-whisper (built on CTranslate2) as an optional or alternative backend implementation.
Benefits
- Speed: Up to 4x faster execution compared to vanilla OpenAI Whisper at the same precision level.
- Efficiency: Uses integer quantization (
int8, float16), allowing models like base and small to run exceptionally fast and light on host CPUs without crashing or swapping memory.
Proposed Implementation Details
Because faster-whisper returns an iterable generator of segment objects rather than a static dictionary payload, the transcribe() loop needs to unpack the generator tuple and read attributes natively rather than accessing keys:
segments_generator, info = self._get_model().transcribe(
audio_path,
word_timestamps=True,
language=self._language,
initial_prompt=self._initial_prompt,
)
for segment_info in segments_generator:
segment_start = float(segment_info.start)
# Map attributes down into Document -> Segment -> Line -> Word structures...
We could either introduce a backend="vanilla" | "faster" flag in the transcriber configuration or split them into explicit WhisperAudioTranscriber and FasterWhisperAudioTranscriber classes.
Currently,
WhisperAudioTranscriberrelies exclusively on the vanillaopenai-whisperpackage. While accurate, it runs relatively slow on standard CPU environments and uses a larger VRAM/RAM footprint compared to optimized execution backends.I would like to propose adding
faster-whisper(built on CTranslate2) as an optional or alternative backend implementation.Benefits
int8,float16), allowing models likebaseandsmallto run exceptionally fast and light on host CPUs without crashing or swapping memory.Proposed Implementation Details
Because
faster-whisperreturns an iterable generator of segment objects rather than a static dictionary payload, thetranscribe()loop needs to unpack the generator tuple and read attributes natively rather than accessing keys:We could either introduce a backend="vanilla" | "faster" flag in the transcriber configuration or split them into explicit
WhisperAudioTranscriberandFasterWhisperAudioTranscriberclasses.