Skip to main content

downloadWhisperModel()v4.0.115

Downloads a Whisper.cpp model to a folder.
You should first install Whisper.cpp, for example through installWhisperCpp().

install-whisper.mjs
tsx
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"),
});
install-whisper.mjs
tsx
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"),
});

Options

folder

The folder to download the model to. The model will be downloaded into this folder with the filename ggml-${model}.bin.

model

The model to download. Possible values: tiny, tiny.en, base, base.en, small, small.en, medium, medium.en, large-v1, large-v2, large-v3.

onProgress?

Act upon download progress. This is the function signature:

tsx
import type { OnProgress } from "@remotion/install-whisper-cpp";
 
const onProgress: OnProgress = (
downloadedBytes: number,
totalBytes: number,
) => {
const progress = downloadedBytes / totalBytes;
};
tsx
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?v4.0.156

A signal from an AbortController to cancel the download process.

Return Value

Returns an object with the following property:

alreadyExisted

Indicates 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.

See also