Skip to content

Quiet default CLI progress output - #14

Merged
morehardy merged 2 commits into
mainfrom
codex/quiet-cli-progress
May 25, 2026
Merged

Quiet default CLI progress output#14
morehardy merged 2 commits into
mainfrom
codex/quiet-cli-progress

Conversation

@morehardy

Copy link
Copy Markdown
Owner

Summary

  • Hide internal observability step names in default CLI progress while preserving them in --verbose output.
  • Suppress Hugging Face download progress during model loading unless explicitly enabled.
  • Add regression coverage for quiet progress, finalizing state, and model progress suppression behavior.

Test Plan

  • uv run python -m unittest
  • git diff --check

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a quiet mode for the console progress observer, which maps internal step names to user-friendly labels and hides specific processing steps unless the verbose flag is enabled. It also adds logic to suppress Hugging Face model download progress bars during model loading. Feedback was provided to improve the implementation of the download progress suppression by using os.environ.setdefault and simplifying the conditional logic to minimize side effects.

Comment on lines +593 to +607
def _suppress_model_download_progress(self) -> None:
flag = os.environ.get("HF_HUB_DISABLE_PROGRESS_BARS")
if flag is None:
os.environ["HF_HUB_DISABLE_PROGRESS_BARS"] = "1"
explicitly_enabled = False
else:
explicitly_enabled = flag.strip().lower() in {"0", "false", "off", "no"}
if explicitly_enabled:
return

try:
from huggingface_hub.utils import disable_progress_bars
except ImportError:
return
disable_progress_bars()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic for suppressing Hugging Face download progress bars is effective, but it relies on modifying the global os.environ. While acceptable for a CLI tool, consider using os.environ.setdefault or only setting it if it's not already present to minimize side effects. Additionally, the check for explicitly_enabled could be simplified.

Suggested change
def _suppress_model_download_progress(self) -> None:
flag = os.environ.get("HF_HUB_DISABLE_PROGRESS_BARS")
if flag is None:
os.environ["HF_HUB_DISABLE_PROGRESS_BARS"] = "1"
explicitly_enabled = False
else:
explicitly_enabled = flag.strip().lower() in {"0", "false", "off", "no"}
if explicitly_enabled:
return
try:
from huggingface_hub.utils import disable_progress_bars
except ImportError:
return
disable_progress_bars()
def _suppress_model_download_progress(self) -> None:
flag = os.environ.get("HF_HUB_DISABLE_PROGRESS_BARS")
if flag is not None and flag.strip().lower() in {"0", "false", "off", "no"}:
return
os.environ.setdefault("HF_HUB_DISABLE_PROGRESS_BARS", "1")
try:
from huggingface_hub.utils import disable_progress_bars
disable_progress_bars()
except ImportError:
pass

@morehardy
morehardy merged commit dd82158 into main May 25, 2026
2 checks passed
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