From 470496b7effb9953e50f9c6cf305ba87de7ac2e3 Mon Sep 17 00:00:00 2001 From: sora <2075279110@qq.com> Date: Fri, 11 Sep 2026 02:43:10 +0000 Subject: [PATCH] Probe line carries model/endpoint/instances/probe-latency (ANSI-colored on tty); semantic numbers (counts, checkpoint fractions) bold in narration lines Co-Authored-By: Claude --- evalharness/cli.py | 7 +++++++ evalharness/model/runner.py | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/evalharness/cli.py b/evalharness/cli.py index 08e0b45..05ff19a 100644 --- a/evalharness/cli.py +++ b/evalharness/cli.py @@ -202,6 +202,13 @@ def _print_run_plan(console, args, model_spec): def _narration(msg: str) -> str: """Icon + path-highlighting for narration lines (visual separation at a glance; paths in cyan).""" + # semantic numbers get bold: samples counts, checkpoint fractions, + # generation counts, few-shot counts (curated, not rich's blanket highlight) + import re as _re0 + + msg = _re0.sub(r'(? None: """ if getattr(adapter, 'name', '') == 'mock': return + _probe_model._t0 = time.monotonic() members = getattr(adapter, 'adapters', [adapter]) if model_spec in _PROBED_SPECS: return @@ -549,8 +550,18 @@ 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: - msg = f'model endpoint ok ({len(members)} instance(s), {members[0].api_base})' - print(f'· {msg}', flush=True) # probe runs before status_callback exists + import sys as _sys + + dur = time.monotonic() - _probe_model._t0 if hasattr(_probe_model, '_t0') else 0.0 + name = getattr(members[0], 'model', '') or '?' + url = members[0].api_base + txt = (f'· model endpoint ok · model={name} · endpoint={url} · ' + f'instances={len(members)} · probe={dur:.1f}s') + if _sys.stdout.isatty(): # color the machine-relevant facts on terminals + txt = (f'· model endpoint ok · model=\x1b[1m{name}\x1b[0m · ' + f'endpoint=\x1b[36m{url}\x1b[0m · ' + f'instances={len(members)} · probe={dur:.1f}s') + print(txt, flush=True) # probe runs before status_callback exists _PROBED_SPECS.add(model_spec) async def run_eval(