loadWhisperModel()v4.0.518
Downloads a timestamped Whisper model from remotion.media and initializes it. Calling it before transcribe() lets you show model-loading progress.
load-model.tsimport {loadWhisperModel } from '@remotion/whisper-webgpu'; constresult = awaitloadWhisperModel ({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.
Versions before 4.0.522 downloaded models from Hugging Face. A model cached by an earlier version is downloaded once more from remotion.media, then reused from the new cache entry when using the default Transformers.js cache settings.
Compatibility
| Browsers | Environments | |||||
|---|---|---|---|---|---|---|
Chrome | Firefox | Safari | ||||