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:
|
def _narration(msg: str) -> str:
|
||||||
"""Icon + path-highlighting for narration lines (visual separation at
|
"""Icon + path-highlighting for narration lines (visual separation at
|
||||||
a glance; paths in cyan)."""
|
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 = ''
|
icon = ''
|
||||||
m = msg.lower()
|
m = msg.lower()
|
||||||
if m.startswith('loading/'):
|
if m.startswith('loading/'):
|
||||||
|
|||||||
@ -519,6 +519,7 @@ async def _probe_model(adapter, model_spec: str) -> None:
|
|||||||
"""
|
"""
|
||||||
if getattr(adapter, 'name', '') == 'mock':
|
if getattr(adapter, 'name', '') == 'mock':
|
||||||
return
|
return
|
||||||
|
_probe_model._t0 = time.monotonic()
|
||||||
members = getattr(adapter, 'adapters', [adapter])
|
members = getattr(adapter, 'adapters', [adapter])
|
||||||
if model_spec in _PROBED_SPECS:
|
if model_spec in _PROBED_SPECS:
|
||||||
return
|
return
|
||||||
@ -549,8 +550,18 @@ async def _probe_model(adapter, model_spec: str) -> None:
|
|||||||
' and --model matches the served model name. Verify manually:\n'
|
' and --model matches the served model name. Verify manually:\n'
|
||||||
f' {curl}')
|
f' {curl}')
|
||||||
if members and not bad:
|
if members and not bad:
|
||||||
msg = f'model endpoint ok ({len(members)} instance(s), {members[0].api_base})'
|
import sys as _sys
|
||||||
print(f'· {msg}', flush=True) # probe runs before status_callback exists
|
|
||||||
|
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)
|
_PROBED_SPECS.add(model_spec)
|
||||||
|
|
||||||
async def run_eval(
|
async def run_eval(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user