Use single-thread ONNX runtime for mobile speech
Build and publish frontend / publish (push) Successful in 50s
Build and publish frontend / publish (push) Successful in 50s
This commit is contained in:
@@ -34,5 +34,26 @@ test('model response progress works when content length is absent', async () =>
|
||||
});
|
||||
|
||||
assert.equal((await tracked.arrayBuffer()).byteLength, 3);
|
||||
assert.deepEqual(messages.map(message => message.progress), [{asset: 'runtime', file: 'runtime.wasm', loaded: 3, total: 0}]);
|
||||
assert.deepEqual(messages
|
||||
.map(message => message.progress)
|
||||
.filter(progress => Number.isFinite(progress.loaded)),
|
||||
[{asset: 'runtime', file: 'runtime.wasm', loaded: 3, total: 0}]);
|
||||
});
|
||||
|
||||
test('runtime asset completion reports that initialization follows the download', async () => {
|
||||
const {trackDownloadProgress} = await import('../piper-download-progress.mjs');
|
||||
const response = new Response(new Uint8Array([1, 2]), {headers: {'content-length': '2'}});
|
||||
const messages = [];
|
||||
const tracked = trackDownloadProgress(response, {
|
||||
id: 10,
|
||||
asset: 'runtime',
|
||||
file: 'ort-wasm-simd-threaded.wasm',
|
||||
postMessage: message => messages.push(message),
|
||||
});
|
||||
|
||||
await tracked.arrayBuffer();
|
||||
assert.deepEqual(messages.at(-1).progress, {
|
||||
stage: 'initializing-runtime',
|
||||
file: 'ort-wasm-simd-threaded.wasm',
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user