Skip to content

Conversation

insertmike
Copy link

@insertmike insertmike commented Sep 12, 2025

Abstract

Removes hardcoded device: "webgpu" from model configs to let transformers.js automatically choose the optimal device at runtime. This avoids hard-failure on non-WebGPU environments, where gpu is explicitly set for running inference.

This maintains optimal performance on supported devices while ensuring the example works everywhere.

Before

Hard failure on non-WebGPU environments with "Unsupported device: webgpu

After

Auto-selects WebGPU when available, gracefully falls back to WASM

If device is not specified, transformers.js chooses based on environment (WebGPU when available, otherwise WASM). Avoids 'Unsupported device: webgpu' in non-WebGPU runtimes."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant