### Feature request Add a function to get all the possible valid values of `device` in a given environment (e.g. node, electron, browser). ### Motivation We have `ModelRegistery.get_available_dtypes()` which is a huge help in user onboarding: - Instead of guessing the best dtype for a given machine, we can let the users choose. - We can try different values and see which one works (fallback mechanism). But when it comes to `device`, we're left with guessing. - `auto` has its own problems (#1624) - Without a list, the code for trying fallbacks relies on hard coded strings The value is available as `suportedDevices` in [onnx.js](https://github.com/huggingface/transformers.js/blob/main/packages/transformers/src/backends/onnx.js) but not exposed externally. ### Your contribution I could implement a PR if needed.
Feature request
Add a function to get all the possible valid values of
devicein a given environment (e.g. node, electron, browser).Motivation
We have
ModelRegistery.get_available_dtypes()which is a huge help in user onboarding:But when it comes to
device, we're left with guessing.autohas its own problems (types in example #1624)The value is available as
suportedDevicesin onnx.js but not exposed externally.Your contribution
I could implement a PR if needed.