@remotion/install-whisper-cpp 4.0.207 → 4.0.209

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.
@@ -60,7 +60,7 @@ export type TranscriptionJson<WithTokenLevelTimestamp extends boolean> = {
60
60
  };
61
61
  export type TranscribeOnProgress = (progress: number) => void;
62
62
  export declare const modelToDtw: (model: WhisperModel) => string;
63
- export declare const transcribe: <HasTokenLevelTimestamps extends boolean>({ inputPath, whisperPath, model, modelFolder, translateToEnglish, tokenLevelTimestamps, printOutput, tokensPerItem, language, signal, onProgress, }: {
63
+ export declare const transcribe: <HasTokenLevelTimestamps extends boolean>({ inputPath, whisperPath, model, modelFolder, translateToEnglish, tokenLevelTimestamps, printOutput, tokensPerItem, language, splitOnWord, signal, onProgress, }: {
64
64
  inputPath: string;
65
65
  whisperPath: string;
66
66
  model: WhisperModel;
@@ -70,6 +70,7 @@ export declare const transcribe: <HasTokenLevelTimestamps extends boolean>({ inp
70
70
  printOutput?: boolean | undefined;
71
71
  tokensPerItem?: (true extends HasTokenLevelTimestamps ? never : number | null) | undefined;
72
72
  language?: Language | null | undefined;
73
+ splitOnWord?: boolean | undefined;
73
74
  signal?: AbortSignal | undefined;
74
75
  onProgress?: TranscribeOnProgress | undefined;
75
76
  }) => Promise<TranscriptionJson<HasTokenLevelTimestamps>>;
@@ -58,7 +58,7 @@ const modelToDtw = (model) => {
58
58
  return model;
59
59
  };
60
60
  exports.modelToDtw = modelToDtw;
61
- const transcribeToTemporaryFile = async ({ fileToTranscribe, whisperPath, model, tmpJSONPath, modelFolder, translate, tokenLevelTimestamps, printOutput, tokensPerItem, language, signal, onProgress, }) => {
61
+ const transcribeToTemporaryFile = async ({ fileToTranscribe, whisperPath, model, tmpJSONPath, modelFolder, translate, tokenLevelTimestamps, printOutput, tokensPerItem, language, splitOnWord, signal, onProgress, }) => {
62
62
  const modelPath = (0, download_whisper_model_1.getModelPath)(modelFolder !== null && modelFolder !== void 0 ? modelFolder : whisperPath, model);
63
63
  if (!node_fs_1.default.existsSync(modelPath)) {
64
64
  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`);
@@ -77,6 +77,7 @@ const transcribeToTemporaryFile = async ({ fileToTranscribe, whisperPath, model,
77
77
  ['-pp'], // print progress
78
78
  translate ? '-tr' : null,
79
79
  language ? ['-l', language.toLowerCase()] : null,
80
+ splitOnWord ? ['--split-on-word', splitOnWord] : null,
80
81
  ]
81
82
  .flat(1)
82
83
  .filter(Boolean);
@@ -131,7 +132,7 @@ const transcribeToTemporaryFile = async ({ fileToTranscribe, whisperPath, model,
131
132
  });
132
133
  return { outputPath };
133
134
  };
134
- const transcribe = async ({ inputPath, whisperPath, model, modelFolder, translateToEnglish = false, tokenLevelTimestamps, printOutput = true, tokensPerItem, language, signal, onProgress, }) => {
135
+ const transcribe = async ({ inputPath, whisperPath, model, modelFolder, translateToEnglish = false, tokenLevelTimestamps, printOutput = true, tokensPerItem, language, splitOnWord, signal, onProgress, }) => {
135
136
  if (!(0, node_fs_1.existsSync)(whisperPath)) {
136
137
  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.`);
137
138
  }
@@ -154,6 +155,7 @@ const transcribe = async ({ inputPath, whisperPath, model, modelFolder, translat
154
155
  tokensPerItem: tokenLevelTimestamps ? 1 : tokensPerItem !== null && tokensPerItem !== void 0 ? tokensPerItem : 1,
155
156
  language: language !== null && language !== void 0 ? language : null,
156
157
  signal: signal !== null && signal !== void 0 ? signal : null,
158
+ splitOnWord: splitOnWord !== null && splitOnWord !== void 0 ? splitOnWord : null,
157
159
  onProgress: onProgress !== null && onProgress !== void 0 ? onProgress : null,
158
160
  });
159
161
  const json = (await readJson(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.207",
6
+ "version": "4.0.209",
7
7
  "description": "Helpers for installing and using Whisper.cpp",
8
8
  "main": "dist/index.js",
9
9
  "sideEffects": false,