The Whisper class is responsible for managing the lifecycle and operations of whisper model. It handles the loading and offloading of the model, managing transcription tasks, and configuring model parameters.

Constructors

  • Constructs a new Whisper instance with a specified model file and configuration.

    Parameters

    • file: string

      The path to the Whisper model file.

    • config: Partial<WhisperConfig> = {}

      Optional configuration for the Whisper instance.

    Returns Whisper

Properties

_available: null | WhisperModel = null
_config: WhisperConfig
_file: string
_loading: null | Promise<WhisperModel> = null
_offload_timer: null | Timeout = null
_tasks: Promise<TranscribeResult[]>[] = []

Accessors

Methods

  • Loads the whisper model asynchronously. If the model is already being loaded, returns the existing one.

    You don't need to call this method directly, it's called automatically if necessary when you call Whisper.transcribe.

    Returns Promise<WhisperModel>

    A Promise that resolves to the loaded model.