From 5734f7fbe623a2e2d13c01fdde9610de648a375c Mon Sep 17 00:00:00 2001 From: sora <2075279110@qq.com> Date: Thu, 10 Sep 2026 11:15:04 +0000 Subject: [PATCH] Uniform [i/N] prefix on every narration line (status_callback restores the tag; checkpoint-restored detail routes through status_callback; probe line remains pre-callback) Co-Authored-By: Claude --- evalharness/cli.py | 3 ++- evalharness/model/runner.py | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/evalharness/cli.py b/evalharness/cli.py index e3f4bf7..ea4836d 100644 --- a/evalharness/cli.py +++ b/evalharness/cli.py @@ -528,9 +528,10 @@ def _cmd_eval_run(args) -> int: def status_callback(msg, _idx=i + 1, _name=name, _reporter=progress_reporter, _console=console): + _tag = f'[{_idx}/{total_runs}] ' if total_runs > 1 else '' if _reporter is not None: _col = _phase_color(msg) - _reporter.log(f'[{_col}]{_name}: {msg}[/{_col}]') + _reporter.log(f'[{_col}]{_tag}{_name}: {msg}[/{_col}]') if 'scoring' in msg: _reporter.set_phase('scoring') elif 'generating model responses' in msg: diff --git a/evalharness/model/runner.py b/evalharness/model/runner.py index e6b6b20..a720fc1 100644 --- a/evalharness/model/runner.py +++ b/evalharness/model/runner.py @@ -399,8 +399,12 @@ async def generate_predictions( else: pending.append((i, s)) if ckpt_store is not None and restored: - print(f'checkpoint: restored {len(restored)} predictions ' - f'({len(pending)} to generate) -> {ckpt_store.path}', flush=True) + line = (f'checkpoint restored {len(restored)} predictions ' + f'({len(pending)} to generate) -> {ckpt_store.path}') + if status_callback: + status_callback(line) + else: + print(f'checkpoint: {line}', flush=True) if status_callback: status_callback(f'checkpoint restored: {len(restored)} ready, {len(pending)} pending') @@ -544,8 +548,8 @@ async def _probe_model(adapter, model_spec: str) -> None: ' and --model matches the served model name. Verify manually:\n' f' {curl}') if members and not bad: - print(f'· model endpoint ok ({len(members)} instance(s), ' - f'{members[0].api_base})', flush=True) + msg = f'model endpoint ok ({len(members)} instance(s), {members[0].api_base})' + print(f'· {msg}', flush=True) # probe runs before status_callback exists _PROBED_SPECS.add(model_spec) async def run_eval(