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
+7
View File
@@ -5,3 +5,10 @@ export function createOnnxWasmPaths(origin) {
return absoluteAssetRoot;
}
export function configureOnnxRuntime(onnxRuntime) {
if (!onnxRuntime?.env?.wasm) throw new TypeError('ONNX Runtime WebAssembly settings are unavailable.');
// Piper already runs in a worker. Avoid a second worker pool on mobile Safari.
onnxRuntime.env.wasm.numThreads = 1;
onnxRuntime.env.wasm.initTimeout = 60000;
}