Use single-thread ONNX runtime for mobile speech
Build and publish frontend / publish (push) Successful in 50s

This commit is contained in:
Ein Anderssono
2026-10-16 08:51:08 +02:00
parent aa832fd7cc
commit a4f89f2b82
9 changed files with 60 additions and 2 deletions
+8
View File
@@ -13,3 +13,11 @@ test('ONNX Runtime base URL rejects an invalid worker origin', async () => {
const {createOnnxWasmPaths} = await import('../piper-onnx-config.mjs');
assert.throws(() => createOnnxWasmPaths('undefined'), TypeError);
});
test('ONNX Runtime uses one thread and a bounded startup timeout', async () => {
const {configureOnnxRuntime} = await import('../piper-onnx-config.mjs');
const runtime = {env: {wasm: {numThreads: 0, initTimeout: 0}}};
configureOnnxRuntime(runtime);
assert.equal(runtime.env.wasm.numThreads, 1);
assert.equal(runtime.env.wasm.initTimeout, 60000);
});