@remotion/whisper-webgpu 4.0.534 → 4.0.535
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.
- package/dist/esm/index.mjs +29 -55
- package/package.json +3 -3
package/dist/esm/index.mjs
CHANGED
|
@@ -1,36 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
__defProp(to, key, {
|
|
12
|
-
get: () => mod[key],
|
|
13
|
-
enumerable: true
|
|
14
|
-
});
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __export = (target, all) => {
|
|
18
|
-
for (var name in all)
|
|
19
|
-
__defProp(target, name, {
|
|
20
|
-
get: all[name],
|
|
21
|
-
enumerable: true,
|
|
22
|
-
configurable: true,
|
|
23
|
-
set: (newValue) => all[name] = () => newValue
|
|
24
|
-
});
|
|
1
|
+
var __esm = (fn, res, err) => () => {
|
|
2
|
+
if (fn)
|
|
3
|
+
try {
|
|
4
|
+
res = fn(fn = 0);
|
|
5
|
+
} catch (e) {
|
|
6
|
+
err = [e];
|
|
7
|
+
}
|
|
8
|
+
if (err)
|
|
9
|
+
throw err[0];
|
|
10
|
+
return res;
|
|
25
11
|
};
|
|
26
|
-
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
27
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
28
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
29
|
-
}) : x)(function(x) {
|
|
30
|
-
if (typeof require !== "undefined")
|
|
31
|
-
return require.apply(this, arguments);
|
|
32
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
33
|
-
});
|
|
34
12
|
|
|
35
13
|
// src/import-node-module.ts
|
|
36
14
|
var importNodeModule = (specifier) => {
|
|
@@ -39,10 +17,6 @@ var importNodeModule = (specifier) => {
|
|
|
39
17
|
};
|
|
40
18
|
|
|
41
19
|
// src/probe-node-webgpu.ts
|
|
42
|
-
var exports_probe_node_webgpu = {};
|
|
43
|
-
__export(exports_probe_node_webgpu, {
|
|
44
|
-
probeNodeWebGpu: () => probeNodeWebGpu
|
|
45
|
-
});
|
|
46
20
|
var webGpuProbeModel, probeNodeWebGpu = async () => {
|
|
47
21
|
const { InferenceSession } = await importNodeModule("onnxruntime-node");
|
|
48
22
|
const session = await InferenceSession.create(webGpuProbeModel, {
|
|
@@ -187,17 +161,17 @@ var init_probe_node_webgpu = __esm(() => {
|
|
|
187
161
|
|
|
188
162
|
// src/can-use-whisper-webgpu.ts
|
|
189
163
|
var WhisperWebGpuUnsupportedReason;
|
|
190
|
-
((
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
164
|
+
((WhisperWebGpuUnsupportedReason) => {
|
|
165
|
+
WhisperWebGpuUnsupportedReason["WindowUndefined"] = "window-undefined";
|
|
166
|
+
WhisperWebGpuUnsupportedReason["WebGpuUnavailable"] = "webgpu-unavailable";
|
|
167
|
+
WhisperWebGpuUnsupportedReason["WebGpuRequiresSecureContext"] = "webgpu-requires-secure-context";
|
|
194
168
|
})(WhisperWebGpuUnsupportedReason ||= {});
|
|
195
169
|
var canUseWhisperWebGpu = async () => {
|
|
196
170
|
if (typeof window === "undefined") {
|
|
197
171
|
if (typeof process !== "undefined" && process.release?.name === "node") {
|
|
198
172
|
try {
|
|
199
|
-
|
|
200
|
-
await
|
|
173
|
+
await Promise.resolve().then(() => init_probe_node_webgpu());
|
|
174
|
+
await probeNodeWebGpu();
|
|
201
175
|
return { supported: true };
|
|
202
176
|
} catch (error) {
|
|
203
177
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -962,18 +936,18 @@ var transcribe = async ({
|
|
|
962
936
|
};
|
|
963
937
|
};
|
|
964
938
|
export {
|
|
965
|
-
|
|
966
|
-
toCaptions,
|
|
967
|
-
resampleTo16Khz,
|
|
968
|
-
removeWhisperModel,
|
|
969
|
-
loadWhisperModel,
|
|
970
|
-
isWhisperModelCached,
|
|
971
|
-
getAvailableModels,
|
|
972
|
-
downloadWhisperModel,
|
|
973
|
-
disposeWhisperModel,
|
|
974
|
-
clearStaleModels,
|
|
975
|
-
canUseWhisperWebGpu,
|
|
976
|
-
WhisperWebGpuUnsupportedReason,
|
|
939
|
+
WHISPER_WEBGPU_MODELS,
|
|
977
940
|
WHISPER_WEBGPU_SAMPLE_RATE,
|
|
978
|
-
|
|
941
|
+
WhisperWebGpuUnsupportedReason,
|
|
942
|
+
canUseWhisperWebGpu,
|
|
943
|
+
clearStaleModels,
|
|
944
|
+
disposeWhisperModel,
|
|
945
|
+
downloadWhisperModel,
|
|
946
|
+
getAvailableModels,
|
|
947
|
+
isWhisperModelCached,
|
|
948
|
+
loadWhisperModel,
|
|
949
|
+
removeWhisperModel,
|
|
950
|
+
resampleTo16Khz,
|
|
951
|
+
toCaptions,
|
|
952
|
+
transcribe
|
|
979
953
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/whisper-webgpu",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.535",
|
|
4
4
|
"description": "Transcribe audio in the browser using Whisper and WebGPU",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@remotion/captions": "4.0.
|
|
27
|
+
"@remotion/captions": "4.0.535",
|
|
28
28
|
"onnxruntime-node": "1.24.3"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@huggingface/transformers": "4.2.0",
|
|
43
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
43
|
+
"@remotion/eslint-config-internal": "4.0.535",
|
|
44
44
|
"@typescript/native-preview": "7.0.0-dev.20260217.1",
|
|
45
45
|
"eslint": "9.19.0"
|
|
46
46
|
},
|