Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Draft
chinazhangchao wants to merge3 commits intomain
base:main
Choose a base branch
Loading
fromchao/winmlpost2
Draft

Conversation

chinazhangchao
Copy link
Contributor

Describe your changes

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by runninglintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.
  • Is this PR including examples changes? If yes, please remember to updateexample documentation in a follow-up PR.

(Optional) Issue link

@chinazhangchaochinazhangchao marked this pull request as draftJuly 18, 2025 05:54
returnproviders+list(extra_providers)

ort.get_available_providers=get_available_providers_winml
exceptException:

Check notice

Code scanning / CodeQL

Empty except Note

'except' clause does nothing but pass and there is no explanatory comment.

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.

Suggested changeset1
olive/__init__.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git applydiff --git a/olive/__init__.py b/olive/__init__.py--- a/olive/__init__.py+++ b/olive/__init__.py@@ -30,8 +30,8 @@         return providers + list(extra_providers)      ort.get_available_providers = get_available_providers_winml-except Exception:-    pass+except Exception as e:+    _logger.warning("Optional dependency 'onnxruntime' or its patching failed. Proceeding without ONNX Runtime integration.", exc_info=True)  # pylint: disable=C0413 EOF
@@ -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

@chinazhangchaochinazhangchao changed the titleadd get_ep_devicesFix winml ort compatible issue.Jul 18, 2025
@shaahji
Copy link
Contributor

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.

@jambaykjambayk requested a review fromshaahjiJuly 18, 2025 16:54
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@shaahjishaahjiAwaiting requested review from shaahji

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@chinazhangchao@shaahji

[8]ページ先頭

©2009-2025 Movatter.jp