Skip to main content

loadWhisperModel()v4.0.518

Downloads and initializes a timestamped Whisper model. Calling it before transcribe() lets you show model-loading progress.

load-model.ts
import {loadWhisperModel} from '@remotion/whisper-webgpu'; const result = await loadWhisperModel({ model: 'small.en', onProgress: ({progress}) => { console.log(progress); }, }); console.log(result.alreadyLoaded);

Options​

model​

One of the names returned by getAvailableModels().

onProgress?​

Called while model files are resolved and downloaded. progress is the aggregate download progress between 0 and 1 and never decreases.

Return value​

Returns whether the same model pipeline was already loaded in memory.

The browser manages its persistent Transformers.js cache. This function also retains the initialized model in memory until disposeWhisperModel() is called or the page closes.

Compatibility​

BrowsersEnvironments
Chrome
Firefox
Safari

See also​