Run Parakeet TDT in the inference worker via parakeet.js on the shared onnxruntime-web

Adds parakeet.js 1.4.4 (MIT) as a devDependency bundled into the worker
only; a build plugin keeps its own onnxruntime-web copy out of the bundle.
Includes an opt-in real-model test (PARAKEET_REAL=1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas WintherandClaude Opus 5.5 committed 2026-10-29 22:08:05 +01:00
1 parent c5a57cd33a
commit 708fae5778
10 files changed
+485 -7

No files matched your search

+3
View File
@@ -17,6 +17,7 @@ import { join, relative } from "node:path";
import { injectPrecacheManifest, precachePathsFromOutputs } from "../src/pwa/precache.ts";
import { ensureFonts, FONTS_DIR } from "./fonts.ts";
import { ensureIcons, ICON_SIZES, ICONS_DIR } from "./generate-icons.ts";
import { ortAliasPlugin } from "./ortAlias.ts";
const ROOT = join(import.meta.dir, "..");
const DIST = join(ROOT, "dist");
@@ -50,6 +51,8 @@ const workerBuild = await Bun.build({
target: "browser",
format: "esm",
minify: true,
// One onnxruntime in the bundle (D-WS7a).
plugins: [ortAliasPlugin],
});
const workerScript = await workerBuild.outputs[0]!.text();
await Bun.write(join(DIST, "inference.worker.js"), workerScript);