downloadWhisperModel()v4.0.115
将 Whisper.cpp 模型下载到文件夹中。
您应该首先安装 Whisper.cpp,例如通过 installWhisperCpp()。
install-whisper.mjstsximportpath from "path";import {downloadWhisperModel } from "@remotion/install-whisper-cpp";const {alreadyExisted } = awaitdownloadWhisperModel ({model : "medium.en",folder :path .join (process .cwd (), "whisper.cpp"),});
install-whisper.mjstsximportpath from "path";import {downloadWhisperModel } from "@remotion/install-whisper-cpp";const {alreadyExisted } = awaitdownloadWhisperModel ({model : "medium.en",folder :path .join (process .cwd (), "whisper.cpp"),});
选项
folder
要将模型下载到的文件夹。该模型将以 ggml-${model}.bin 文件名下载到此文件夹中。
model
要下载的模型。可能的值:tiny、tiny.en、base、base.en、small、small.en、medium、medium.en、large-v1、large-v2、large-v3。
onProgress?
根据下载进度执行操作。这是函数签名:
tsximport type {OnProgress } from "@remotion/install-whisper-cpp";constonProgress :OnProgress = (downloadedBytes : number,totalBytes : number,) => {constprogress =downloadedBytes /totalBytes ;};
tsximport type {OnProgress } from "@remotion/install-whisper-cpp";constonProgress :OnProgress = (downloadedBytes : number,totalBytes : number,) => {constprogress =downloadedBytes /totalBytes ;};
printOutput?
将人类可读的进度打印到控制台。默认值:true。
signal?v4.0.156
来自 AbortController 的信号,用于取消下载过程。
返回值
返回具有以下属性的对象:
alreadyExisted
指示输出路径处是否已存在文件。如果存在,则函数不执行任何操作,并将此属性设置为 true。