@remotion/install-whisper-cpp 4.0.507 → 4.0.508

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.
Files changed (2) hide show
  1. package/dist/transcribe.js +12 -2
  2. package/package.json +3 -3
@@ -102,17 +102,27 @@ const transcribeToTemporaryFile = async ({ fileToTranscribe, whisperPath, whispe
102
102
  signal: signal !== null && signal !== void 0 ? signal : undefined,
103
103
  });
104
104
  const predictedPath = `${tmpJSONPath}.json`;
105
+ // The path is fixed and only unlinked on success, so an aborted run leaves
106
+ // a stale file behind. Anything already here was not written by this run.
107
+ const staleOutput = (0, node_fs_1.existsSync)(predictedPath);
105
108
  let output = '';
109
+ let sawProgress = false;
106
110
  const onData = (data) => {
107
111
  const str = data.toString('utf-8');
108
112
  const hasProgress = str.includes('progress =');
109
113
  if (hasProgress) {
114
+ sawProgress = true;
110
115
  const progress = parseFloat(str.split('progress =')[1].trim());
111
116
  onProgress === null || onProgress === void 0 ? void 0 : onProgress(progress / 100);
112
117
  }
113
118
  output += str;
114
- // Sometimes it hangs here
115
- if (str.includes('ggml_metal_free: deallocating')) {
119
+ // Sometimes it hangs here, but only after the output is written. Where
120
+ // Metal exists yet cannot be used, Whisper prints the same line while
121
+ // falling back to CPU at startup, so wait for evidence of actual work.
122
+ // If progress is disabled and a stale output exists, we deliberately let
123
+ // Whisper continue rather than risk killing it and returning stale data.
124
+ if (str.includes('ggml_metal_free: deallocating') &&
125
+ (sawProgress || (!staleOutput && (0, node_fs_1.existsSync)(predictedPath)))) {
116
126
  task.kill();
117
127
  }
118
128
  };
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.507",
6
+ "version": "4.0.508",
7
7
  "description": "Helpers for installing and using Whisper.cpp",
8
8
  "main": "dist/index.js",
9
9
  "bugs": {
@@ -19,11 +19,11 @@
19
19
  "author": "Jonny Burger <jonny@remotion.dev>",
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
- "@remotion/captions": "4.0.507"
22
+ "@remotion/captions": "4.0.508"
23
23
  },
24
24
  "peerDependencies": {},
25
25
  "devDependencies": {
26
- "@remotion/eslint-config-internal": "4.0.507",
26
+ "@remotion/eslint-config-internal": "4.0.508",
27
27
  "eslint": "9.19.0",
28
28
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
29
29
  },