Skip to content

Hide inspect warning noise - #1232

Open
DingmaomaoBJTU wants to merge 1 commit into
mainfrom
dingmaomaobjtu-hide-inspect-warnings
Open

Hide inspect warning noise#1232
DingmaomaoBJTU wants to merge 1 commit into
mainfrom
dingmaomaobjtu-hide-inspect-warnings

Conversation

@DingmaomaoBJTU

Copy link
Copy Markdown
Collaborator

Summary

  • Hide Hugging Face, Transformers, and native ONNX Runtime warning noise during normal winml inspect runs.
  • Preserve diagnostics through -v, -vv, and WINMLCLI_SHOW_ALL_WARNINGS=1.
  • Scope Hugging Face warning suppression to inspect and restore logger/env/library verbosity state afterward.
  • Add regression coverage for suppression, opt-outs, native stderr behavior, and state restoration.

Validation

  • python -m ruff check src\winml\modelkit\commands\inspect.py src\winml\modelkit\utils\logging.py src\winml\modelkit\utils\native_stderr.py tests\cli\test_import_time.py tests\unit\commands\test_inspect_cli.py tests\unit\utils\test_logging.py tests\unit\utils\test_native_stderr.py
  • python -m pytest tests\unit\utils\test_logging.py tests\unit\commands\test_inspect_cli.py tests\unit\utils\test_native_stderr.py tests\cli\test_import_time.py::TestCommandHelp::test_inspect_model_type_hides_onnxruntime_startup_warning -q
  • python -m winml.modelkit inspect -m facebook/convnext-tiny-224 default / -v / WINMLCLI_SHOW_ALL_WARNINGS=1 smoke checks

Suppress third-party warning chatter during normal inspect runs while preserving verbose diagnostics and restoring scoped logging state.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@DingmaomaoBJTU
DingmaomaoBJTU requested a review from a team as a code owner July 27, 2026 10:20
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