Scoring line: colon restored, full sentence (score over N samples), score keeps solid green with yellow phrase tail; path coloring covers 'to /abs' endings
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
d7f06395a0
commit
0ca8aedefe
@ -228,10 +228,16 @@ def _narration(msg: str) -> str:
|
||||
# gets bold green -- it is what the eye should find first
|
||||
import re as _re1
|
||||
|
||||
m = _re1.search(r'[:·] ([a-zA-Z_@]+ [0-9.]+%)$', msg)
|
||||
m = _re1.search(r'[:·] ([a-zA-Z_@]+ [0-9.]+%)(?=\s|$)', msg)
|
||||
if m:
|
||||
return (f'{icon}{msg[:m.start()]}'
|
||||
f'[bold green]{m.group(1)}[/bold green]')
|
||||
head = f'{icon}{msg[:m.start()]}: [bold green]{m.group(1)}[/bold green]'
|
||||
tail = msg[m.end():]
|
||||
if tail:
|
||||
import re as _re2
|
||||
|
||||
tail = _re2.sub(r'(?<![\w/%.])(\d+(?:/\d+)?(?:\s+[a-z-]+){0,4})(?=[\s,.]|$)',
|
||||
r'[bold yellow]\1[/bold yellow]', tail)
|
||||
return head + tail
|
||||
|
||||
# semantic PHRASES get color, not bare numbers: '164 samples from cache',
|
||||
# '4/4 predictions' -- a lone number is easy to lose. Runs AFTER the
|
||||
@ -240,10 +246,11 @@ def _narration(msg: str) -> str:
|
||||
|
||||
msg = _re0.sub(r'(?<![\w/%.])(\d+(?:/\d+)?(?:\s+[a-z-]+){0,4})(?=[\s,.]|$)',
|
||||
r'[bold yellow]\1[/bold yellow]', msg)
|
||||
# highlight any trailing path after '->'
|
||||
if '-> ' in msg:
|
||||
head, _, tail = msg.partition('-> ')
|
||||
return f'{icon}{head}-> [cyan]{tail}[/cyan]'
|
||||
# highlight any trailing path after '->' or 'to' (only absolute paths)
|
||||
for sep in ('-> ', 'to '):
|
||||
head, _, tail = msg.rpartition(sep)
|
||||
if head and tail.startswith('/'):
|
||||
return f'{icon}{head}{sep}[cyan]{tail}[/cyan]'
|
||||
return f'{icon}{msg}'
|
||||
|
||||
|
||||
|
||||
@ -747,7 +747,8 @@ async def run_eval(
|
||||
_m = next(((k, v) for k, v in report.metrics.items()
|
||||
if k != 'extraction_failure_rate'), None)
|
||||
status_callback(f'Scoring complete: {_m[0]} {_m[1] * 100:.1f}% '
|
||||
if _m else 'scoring complete')
|
||||
f'over {report.num_samples} samples'
|
||||
if _m else 'Scoring complete')
|
||||
# performance profile: pool success rate + latency/ttft percentiles
|
||||
try:
|
||||
from .aggregator import get_aggregator
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user