WebNN support initial

This commit is contained in:
Lucas Winther
2026-07-10 11:18:03 +02:00
parent 71cb61cd90
commit db7b8a22c4
5 changed files with 41 additions and 17 deletions
+7 -1
View File
@@ -24,6 +24,7 @@ interface ModelPickerProps {
const DEVICE_OPTIONS: readonly { value: DevicePreference; label: string }[] = [
{ value: "auto", label: "Auto (WebGPU if available)" },
{ value: "webgpu", label: "WebGPU" },
{ value: "webnn", label: "WebNN" },
{ value: "wasm", label: "WASM (CPU)" },
];
@@ -47,7 +48,12 @@ export function ModelPicker({
// the device. Until the worker has reported one, assume WASM unless the
// user explicitly asked for WebGPU.
const estimateDevice: InferenceDevice =
activeDevice ?? (devicePreference === "webgpu" ? "webgpu" : "wasm");
activeDevice ??
(devicePreference === "webgpu"
? "webgpu"
: devicePreference === "webnn"
? "webnn"
: "wasm");
const groups: { title: string; items: WhisperModel[] }[] = [
{