sora 370953729b Fix perf stats (wrong import path), per-repeat checkpoints, README
- perf_stats aggregator lives in eval/, not model/: the import failed
  silently and EVERY perf column was empty (not just ttft). Now warns
  on stderr instead of swallowing.
- repeats > 1 get their own checkpoint key (:rep2, :rep3, ...): repeat 2
  previously restored repeat 1's predictions and finished instantly with
  identical scores. rep1 keeps the legacy key (existing checkpoints still
  resume).
- repeats summary: report the MEAN score and aggregate time/tokens over
  ALL runs (was: last run only).
- README: six-benchmark command as the primary example.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-11 13:38:04 +00:00

42 lines
1.2 KiB
Python

"""Default narration theme: icons per stage, green facts, blue paths."""
from . import register_theme
ICONS = [
('loading/', ''),
('dataset ready', '📦 '),
('few-shot', ''),
('checkpoint', ''),
('generation skipped', ''),
('generating', '🤖 '),
('generation complete', ''),
('scoring', ''),
('writing', '📝 '),
('endpoint', '🔗 '),
]
FACT_COLOR = 'green' # numbers/phrases/scores
PATH_COLOR = 'blue' # filesystem locations
@register_theme('default')
def narrate(msg: str) -> str:
import re
low = msg.lower()
icon = next((i for k, i in ICONS if k in low), '')
def fact(text):
return re.sub(r'(?<![\w/%.])(\d+(?:/\d+)?(?:\s+[a-z-]+){0,4})(?=[\s,.]|$)',
rf'[{FACT_COLOR}]\1[/{FACT_COLOR}]', text)
m = re.search(r'[:·] ([a-zA-Z_@]+ [0-9.]+%)(?=\s|$)', msg)
if m:
head = f'{icon}{msg[:m.start()]}: [bold {FACT_COLOR}]{m.group(1)}[/bold {FACT_COLOR}]'
return head + fact(msg[m.end():])
for sep in ('-> ', 'to '):
head, _, tail = msg.rpartition(sep)
if head and tail.startswith('/'):
return f'{icon}{head}{sep}[{PATH_COLOR}]{tail}[/{PATH_COLOR}]'
return f'{icon}{fact(msg)}'