Skip to content

add faster-whisper as an alternative transcription backend #20

Description

@ucscode

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions