Skip to content

fix(cli): quiet third-party optimum logger noise in normal output#904

Open
timenick wants to merge 1 commit into
mainfrom
zhiwang/quiet-optimum-cli-logs
Open

fix(cli): quiet third-party optimum logger noise in normal output#904
timenick wants to merge 1 commit into
mainfrom
zhiwang/quiet-optimum-cli-logs

Conversation

@timenick

Copy link
Copy Markdown
Collaborator

Summary

optimum emits informational WARNINGs that leak into normal CLI output and interleave with the rich progress spinner. The most visible:

No model type passed for the task image-to-text, that may be mapped to several loading classes (('AutoModelForVision2Seq', 'AutoModel')). Defaulting to AutoModelForVision2Seq to load the model.

It surfaces when inspecting image-to-text / vision-encoder-decoder models (e.g. microsoft/trocr-base-printed), mangling the live ⠧ Resolving … spinner line.

Fix

configure_logging now floors noisy third-party loggers (optimum) at ERROR in normal output; with -v/-vv they follow the CLI verbosity level, so the detail stays available on demand.

This is a logging-hygiene fix at the configuration boundary — it does not match message text and does not change how optimum is called.

Notes

  • Pre-existing, not from the recent task-detection work: verified at a pre-refactor(task): unify detection into resolve_task/TaskResolution; fix inspect source #878 commit with period-correct deps (uv run, not --no-sync) — still reproduces. optimum>=2 has been pinned since the initial commit.
  • Before: normal winml inspect -m microsoft/trocr-base-printed leaks the warning onto the spinner line.
  • After: normal output is clean; -v still shows the notice.

optimum emits informational WARNINGs that leak into CLI output and interleave with the
rich progress spinner -- e.g. "No model type passed for the task image-to-text, that may
be mapped to several loading classes ... Defaulting to AutoModelForVision2Seq" when a task
maps to several loader classes (surfaced inspecting image-to-text / vision-encoder-decoder
models like microsoft/trocr-base-printed).

configure_logging now floors noisy third-party loggers (optimum) at ERROR in normal output;
with -v/-vv they follow the CLI level so the detail stays available on demand. This is a
logging-hygiene fix at the config boundary -- it does not match message text or change how
optimum is called. Pre-existing (reproduces before the recent task-detection work).
@timenick timenick requested a review from a team as a code owner June 16, 2026 09:06
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