Skip to content

Commit 965c483

Browse files
committed
Recognize onnxruntime-windowsml in onnxruntime version detection
When users install the Windows ML onnxruntime variant (`pip install onnxruntime-windowsml`), `find_spec("onnxruntime")` still resolves successfully, but none of the package names in the metadata-lookup fallback match, so `importlib_metadata.version(pkg)` fails for every candidate and `_onnx_available` ends up False (see #13062). Add `onnxruntime-windowsml` to the candidate list alongside the other vendor-specific wheels (DirectML, CANN, OpenVINO, …) so installations that ship only this variant are detected. Fixes #13062
1 parent c8c8401 commit 965c483

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/diffusers/utils/import_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ def _is_package_available(pkg_name: str, get_dist_name: bool = False) -> tuple[b
140140
"onnxruntime-rocm",
141141
"onnxruntime-training",
142142
"onnxruntime-vitisai",
143+
"onnxruntime-windowsml",
143144
)
144145
_onnxruntime_version = None
145146
# For the metadata, we have to look for both onnxruntime and onnxruntime-x

0 commit comments

Comments
 (0)