Keep Parakeet on WASM unless WebGPU is chosen explicitly, and never offer it on phones
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
827e9a8dae
commit
c5a57cd33a
@@ -2,6 +2,7 @@ import { describe, test, expect } from "bun:test";
|
||||
import {
|
||||
applyLoadProgress,
|
||||
deviceAttempts,
|
||||
parakeetDeviceAttempts,
|
||||
dtypeRequiresF16,
|
||||
initialLoadProgress,
|
||||
isUiToWorkerMessage,
|
||||
@@ -224,6 +225,29 @@ describe("deviceAttempts (D-004, D-017)", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("parakeetDeviceAttempts (D-WS7a)", () => {
|
||||
const everything = { webnn: true, webgpu: true, webgpuF16: true };
|
||||
|
||||
test("auto never picks an accelerator for Parakeet", () => {
|
||||
expect(parakeetDeviceAttempts("auto", everything)).toEqual(["wasm"]);
|
||||
});
|
||||
|
||||
test("explicit WebGPU is tried (then WASM) only with shader-f16", () => {
|
||||
expect(parakeetDeviceAttempts("webgpu", everything)).toEqual(["webgpu", "wasm"]);
|
||||
expect(parakeetDeviceAttempts("webgpu", { ...everything, webgpuF16: false })).toEqual([
|
||||
"wasm",
|
||||
]);
|
||||
expect(parakeetDeviceAttempts("webgpu", { ...everything, webgpu: false })).toEqual([
|
||||
"wasm",
|
||||
]);
|
||||
});
|
||||
|
||||
test("WebNN and WASM preferences run WASM", () => {
|
||||
expect(parakeetDeviceAttempts("webnn", everything)).toEqual(["wasm"]);
|
||||
expect(parakeetDeviceAttempts("wasm", everything)).toEqual(["wasm"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("TranscribeProgressTracker", () => {
|
||||
// Production shape: 30 s windows advancing by 20 s (30 − 2·5, the worker's
|
||||
// chunk/stride settings), like the chunked ASR pipeline.
|
||||
|
||||
Reference in New Issue
Block a user