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 <noreply@anthropic.com>
This commit is contained in:
parent
b8ff031be7
commit
470496b7ef
@ -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'(?<![\w/])(\d+(?:/\d+)?)(?=[\s]|$)',
|
||||
r'[bold]\1[/bold]', msg)
|
||||
|
||||
icon = ''
|
||||
m = msg.lower()
|
||||
if m.startswith('loading/'):
|
||||
|
||||
@ -519,6 +519,7 @@ async def _probe_model(adapter, model_spec: str) -> 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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user