packages/docs/docs/install-whisper-cpp/download-whisper-model.mdx
Downloads a Whisper.cpp model to a folder.
You should first install Whisper.cpp, for example through installWhisperCpp().
import path from 'path';
import {downloadWhisperModel} from '@remotion/install-whisper-cpp';
const {alreadyExisted} = await downloadWhisperModel({
model: 'medium.en',
folder: path.join(process.cwd(), 'whisper.cpp'),
});
folderThe folder to download the model to. The model will be downloaded into this folder with the filename ggml-${model}.bin.
modelThe model to download. Possible values: tiny, tiny.en, base, base.en, small, small.en, medium, medium.en, large-v1, large-v2, large-v3, large-v3-turbo.
onProgress?Act upon download progress. This is the function signature:
import type {OnProgress} from '@remotion/install-whisper-cpp';
const onProgress: OnProgress = (downloadedBytes: number, totalBytes: number) => {
const progress = downloadedBytes / totalBytes;
};
printOutput?Print human-readable progress to the console. Default: true.
signal?<AvailableFrom v="4.0.156" />A signal from an AbortController to cancel the download process.
Returns an object with the following property:
alreadyExistedIndicates whether a file at the output path already existed. If it did, the function did not do anything and this property is set to true.