@remotion/install-whisper-cpp 4.0.322 → 4.0.324

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,6 +51,7 @@ type Params = {
51
51
  type Result = {
52
52
  language: string;
53
53
  };
54
+ type AdditionalArgs = string[] | [string, string][];
54
55
  export type TranscriptionJson<WithTokenLevelTimestamp extends boolean> = {
55
56
  systeminfo: string;
56
57
  model: Model;
@@ -60,7 +61,7 @@ export type TranscriptionJson<WithTokenLevelTimestamp extends boolean> = {
60
61
  };
61
62
  export type TranscribeOnProgress = (progress: number) => void;
62
63
  export declare const modelToDtw: (model: WhisperModel) => string;
63
- export declare const transcribe: <HasTokenLevelTimestamps extends boolean>({ inputPath, whisperPath, whisperCppVersion, model, modelFolder, translateToEnglish, tokenLevelTimestamps, printOutput, tokensPerItem, language, splitOnWord, signal, onProgress, }: {
64
+ export declare const transcribe: <HasTokenLevelTimestamps extends boolean>({ inputPath, whisperPath, whisperCppVersion, model, modelFolder, translateToEnglish, tokenLevelTimestamps, printOutput, tokensPerItem, language, splitOnWord, signal, onProgress, flashAttention, additionalArgs, }: {
64
65
  inputPath: string;
65
66
  whisperPath: string;
66
67
  whisperCppVersion: string;
@@ -74,5 +75,7 @@ export declare const transcribe: <HasTokenLevelTimestamps extends boolean>({ inp
74
75
  splitOnWord?: boolean;
75
76
  signal?: AbortSignal;
76
77
  onProgress?: TranscribeOnProgress;
78
+ flashAttention?: boolean;
79
+ additionalArgs?: AdditionalArgs;
77
80
  }) => Promise<TranscriptionJson<HasTokenLevelTimestamps>>;
78
81
  export {};
@@ -71,7 +71,7 @@ const modelToDtw = (model) => {
71
71
  return model;
72
72
  };
73
73
  exports.modelToDtw = modelToDtw;
74
- const transcribeToTemporaryFile = async ({ fileToTranscribe, whisperPath, whisperCppVersion, model, tmpJSONPath, modelFolder, translate, tokenLevelTimestamps, printOutput, tokensPerItem, language, splitOnWord, signal, onProgress, }) => {
74
+ const transcribeToTemporaryFile = async ({ fileToTranscribe, whisperPath, whisperCppVersion, model, tmpJSONPath, modelFolder, translate, tokenLevelTimestamps, printOutput, tokensPerItem, language, splitOnWord, signal, onProgress, flashAttention, additionalArgs, }) => {
75
75
  const modelPath = (0, download_whisper_model_1.getModelPath)(modelFolder !== null && modelFolder !== void 0 ? modelFolder : whisperPath, model);
76
76
  if (!node_fs_1.default.existsSync(modelPath)) {
77
77
  throw new Error(`Error: Model ${model} does not exist at ${modelFolder ? modelFolder : modelPath}. Check out the downloadWhisperModel() API at https://www.remotion.dev/docs/install-whisper-cpp/download-whisper-model to see how to install whisper models`);
@@ -91,6 +91,8 @@ const transcribeToTemporaryFile = async ({ fileToTranscribe, whisperPath, whispe
91
91
  translate ? '-tr' : null,
92
92
  language ? ['-l', language.toLowerCase()] : null,
93
93
  splitOnWord ? ['--split-on-word', splitOnWord] : null,
94
+ flashAttention ? ['--flash-attn', 'true'] : null,
95
+ ...(additionalArgs !== null && additionalArgs !== void 0 ? additionalArgs : []),
94
96
  ]
95
97
  .flat(1)
96
98
  .filter(Boolean);
@@ -151,7 +153,7 @@ const transcribeToTemporaryFile = async ({ fileToTranscribe, whisperPath, whispe
151
153
  });
152
154
  return { outputPath };
153
155
  };
154
- const transcribe = async ({ inputPath, whisperPath, whisperCppVersion, model, modelFolder, translateToEnglish = false, tokenLevelTimestamps, printOutput = true, tokensPerItem, language, splitOnWord, signal, onProgress, }) => {
156
+ const transcribe = async ({ inputPath, whisperPath, whisperCppVersion, model, modelFolder, translateToEnglish = false, tokenLevelTimestamps, printOutput = true, tokensPerItem, language, splitOnWord, signal, onProgress, flashAttention, additionalArgs, }) => {
155
157
  if (!(0, node_fs_1.existsSync)(whisperPath)) {
156
158
  throw new Error(`Whisper does not exist at ${whisperPath}. Double-check the passed whisperPath. If you havent installed whisper, check out the installWhisperCpp() API at https://www.remotion.dev/docs/install-whisper-cpp/install-whisper-cpp to see how to install whisper programatically.`);
157
159
  }
@@ -177,6 +179,8 @@ const transcribe = async ({ inputPath, whisperPath, whisperCppVersion, model, mo
177
179
  signal: signal !== null && signal !== void 0 ? signal : null,
178
180
  splitOnWord: splitOnWord !== null && splitOnWord !== void 0 ? splitOnWord : null,
179
181
  onProgress: onProgress !== null && onProgress !== void 0 ? onProgress : null,
182
+ flashAttention,
183
+ additionalArgs,
180
184
  });
181
185
  const json = (await readJson(tmpJSONPath));
182
186
  node_fs_1.default.unlinkSync(tmpJSONPath);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/install-whisper-cpp"
4
4
  },
5
5
  "name": "@remotion/install-whisper-cpp",
6
- "version": "4.0.322",
6
+ "version": "4.0.324",
7
7
  "description": "Helpers for installing and using Whisper.cpp",
8
8
  "main": "dist/index.js",
9
9
  "sideEffects": false,
@@ -16,12 +16,12 @@
16
16
  "author": "Jonny Burger <jonny@remotion.dev>",
17
17
  "license": "SEE LICENSE IN LICENSE.md",
18
18
  "dependencies": {
19
- "@remotion/captions": "4.0.322"
19
+ "@remotion/captions": "4.0.324"
20
20
  },
21
21
  "peerDependencies": {},
22
22
  "devDependencies": {
23
23
  "eslint": "9.19.0",
24
- "@remotion/eslint-config-internal": "4.0.322"
24
+ "@remotion/eslint-config-internal": "4.0.324"
25
25
  },
26
26
  "keywords": [
27
27
  "remotion",