From b7be2a8df37e41c765281f81ca9da890d889ad59 Mon Sep 17 00:00:00 2001 From: sora <2075279110@qq.com> Date: Thu, 10 Sep 2026 11:02:41 +0000 Subject: [PATCH] =?UTF-8?q?Progress=20bars=20self-describing:=20overall=20?= =?UTF-8?q?bar=20carries=20the=20current=20benchmark=20(benches=20=C2=B7?= =?UTF-8?q?=201/6=20humaneval),=20sample=20bar=20carries=20the=20stage=20t?= =?UTF-8?q?ag=20(humaneval=20=C2=B7=20generating/scoring/writing)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- evalharness/cli.py | 12 +++++++++--- evalharness/progress/rich_terminal.py | 15 +++++++++++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/evalharness/cli.py b/evalharness/cli.py index e573988..041d2cd 100644 --- a/evalharness/cli.py +++ b/evalharness/cli.py @@ -504,14 +504,20 @@ def _cmd_eval_run(args) -> int: _shared_reporter.owned_externally = True progress_reporter = _shared_reporter if total_runs > 1: - progress_reporter.set_overall(total_runs, i, 'benches') + progress_reporter.set_overall( + total_runs, i, f'benches · {i + 1}/{total_runs} {name}') def status_callback(msg, _idx=i + 1, _name=name, _reporter=progress_reporter, _console=console): if _reporter is not None: - tag = f'[{_idx}/{total_runs}] ' if total_runs > 1 else '' - _reporter.log(f'{tag}{_name}: {msg}') + _reporter.log(f'{_name}: {msg}') + if 'scoring' in msg: + _reporter.set_phase('scoring') + elif 'generating model responses' in msg: + _reporter.set_phase('generating') + elif 'writing' in msg: + _reporter.set_phase('writing') else: _print_phase(_console, _idx, total_runs, _name, msg) report = asyncio.run(run_eval( diff --git a/evalharness/progress/rich_terminal.py b/evalharness/progress/rich_terminal.py index 52f0a49..fcb40a1 100644 --- a/evalharness/progress/rich_terminal.py +++ b/evalharness/progress/rich_terminal.py @@ -38,6 +38,7 @@ class RichTerminalProgress: refresh_per_second=4, ) self.task_id = None + self.bench_name = '' self.started = 0.0 self.current_started = 0.0 self.inflight = 0 @@ -84,19 +85,29 @@ class RichTerminalProgress: """Start (or re-target) the per-sample task for the next benchmark.""" self.started = time.monotonic() self.inflight = 0 + self.bench_name = description + desc = f'[green]{description} · generating[/green]' if self.task_id is None: self.progress.start() self.task_id = self.progress.add_task( - f'[green]{description}', total=total, completed=min(completed, total), + desc, total=total, completed=min(completed, total), success=completed, failed=0, rate='0.00', inflight=0, waiting='00:00', last_result='restored') self.heartbeat_task = asyncio.create_task(self._heartbeat()) else: - self.progress.update(self.task_id, description=f'[green]{description}', + self.progress.update(self.task_id, description=desc, total=total, completed=min(completed, total), success=completed, failed=0, rate='0.00', inflight=0, last_result='restored') + def set_phase(self, phase: str): + """Retag the sample bar with what is happening (generating/scoring/ + writing) -- the bar alone does not say which stage we are in.""" + if self.task_id is not None: + self.progress.update( + self.task_id, + description=f'[green]{self.bench_name} · {phase}[/green]') + def begin_sample(self, label: str): if self.task_id is None: return