MCPcopy Create free account
hub / github.com/unslothai/unsloth / _progress

Function _progress

studio/install_python_stack.py:1637–1653  ·  view source on GitHub ↗

Print an in-place progress bar aligned to the step column layout.

(label: str)

Source from the content-addressed store, hash-verified

1635
1636
1637def _progress(label: str) -> None:
1638 """Print an in-place progress bar aligned to the step column layout."""
1639 global _STEP, _PROGRESS_LINE_ACTIVE
1640 _STEP += 1
1641 if VERBOSE:
1642 return
1643 width = 20
1644 filled = int(width * _STEP / _TOTAL)
1645 bar = "=" * filled + "-" * (width - filled)
1646 pad = " " * (_COL - len(_LABEL))
1647 end = "\n" if _STEP >= _TOTAL else ""
1648 try:
1649 sys.stdout.write(f"\r {_dim(_LABEL)}{pad}[{bar}] {_STEP:2}/{_TOTAL} {label:<20}{end}")
1650 sys.stdout.flush()
1651 _PROGRESS_LINE_ACTIVE = end == ""
1652 except OSError:
1653 pass
1654
1655
1656def run(

Callers 1

install_python_stackFunction · 0.70

Calls 3

_dimFunction · 0.85
writeMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…