Summary
_warnings.py has "demote WARNING→INFO" logging filters that, given how the CLI gates logging, relabel records but don't actually hide them. One of them — _HFSymlinksInfoFilter (added in #647) — is now fully dead code, shadowed by a hard filterwarnings("ignore") added later in #709.
Details
1. _HFSymlinksInfoFilter never runs.
2. Demote-to-INFO doesn't suppress — it only relabels.
The CLI uses the root logger level as the sole gate (handler is NOTSET, see utils/logging.py). That gate is evaluated at emit time on the record's original level; a filter that later rewrites levelno WARNING→INFO runs after the gate has passed, and the NOTSET handler doesn't re-filter — so the record still prints, just labeled INFO. Empirically, _TasksManagerFilter ("TasksManager returned …") still prints in default verbosity as an INFO line; it is not hidden.
Impact
Cosmetic / low — no functional bug. But _HFSymlinksInfoFilter is misleading dead code, and _TasksManagerFilter doesn't hide what it appears to.
Suggested cleanup
Summary
_warnings.pyhas "demoteWARNING→INFO" logging filters that, given how the CLI gates logging, relabel records but don't actually hide them. One of them —_HFSymlinksInfoFilter(added in #647) — is now fully dead code, shadowed by a hardfilterwarnings("ignore")added later in #709.Details
1.
_HFSymlinksInfoFilternever runs.405272d7f) added_HFSymlinksInfoFilteron thepy.warningslogger to demote thehuggingface_hubsymlinksUserWarningto INFO ("hidden by default, visible at-v").f12db93a5) later addedwarnings.filterwarnings("ignore", message=r".*huggingface_hub.*cache-system.*symlinks.*"), which drops the warning at the Pythonwarningslayer beforecaptureWarningsroutes it topy.warnings. The demote filter never executes.-v); the filter does nothing.2. Demote-to-INFO doesn't suppress — it only relabels.
The CLI uses the root logger level as the sole gate (handler is
NOTSET, seeutils/logging.py). That gate is evaluated at emit time on the record's original level; a filter that later rewriteslevelnoWARNING→INFOruns after the gate has passed, and theNOTSEThandler doesn't re-filter — so the record still prints, just labeled INFO. Empirically,_TasksManagerFilter("TasksManager returned …") still prints in default verbosity as an INFO line; it is not hidden.Impact
Cosmetic / low — no functional bug. But
_HFSymlinksInfoFilteris misleading dead code, and_TasksManagerFilterdoesn't hide what it appears to.Suggested cleanup
_HFSymlinksInfoFilter(its effect is now provided by thefilterwarnings("ignore")in fix: suppress ORT native stderr, fix HANDLE bug, clean up warnings #709), or decide the HF notice should be visible at-vand implement it via a verbosity-conditional logger floor.-v", use a verbosity-conditionalsetLevelfloor (as in fix(cli): quiet third-party optimum logger noise in normal output #904) rather than a demote filter.