- Notifications
You must be signed in to change notification settings - Fork227
Fix winml ort compatible issue.#1984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
returnproviders+list(extra_providers) | ||
ort.get_available_providers=get_available_providers_winml | ||
exceptException: |
Check notice
Code scanning / CodeQL
Empty except Note
Show autofix suggestionHide autofix suggestion
Copilot Autofix
AI about 14 hours ago
The best way to fix this problem is to replace the emptyexcept
block with one that logs the exception using the_logger
already defined in the module. This way, any issues encountered during the import or monkey-patching ofonnxruntime
will be recorded, making debugging easier, while still allowing the code to proceed if the import fails (preserving existing functionality). The logging should include the exception information withexc_info=True
to capture the traceback. No new methods or imports are required since_logger
is already present.
@@ -30,8 +30,8 @@ | ||
returnproviders+list(extra_providers) | ||
ort.get_available_providers=get_available_providers_winml | ||
exceptException: | ||
pass | ||
exceptExceptionase: | ||
_logger.warning("Optional dependency 'onnxruntime' or its patching failed. Proceeding without ONNX Runtime integration.",exc_info=True) | ||
# pylint: disable=C0413 | ||
What problem is this PR attempting to solve? Please provide an explanation as to why this patch is required. Olive doesn't include any specific/special logic to deal with winml. All relevant branching logic should be based on ort version only. |
Describe your changes
Checklist before requesting a review
lintrunner -a
(Optional) Issue link