Narration lines all plain white (color scheme toggle kept in _phase_color for quick restore)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
5734f7fbe6
commit
5b595f3a10
@ -199,10 +199,11 @@ def _print_run_plan(console, args, model_spec):
|
||||
|
||||
|
||||
def _phase_color(message: str) -> str:
|
||||
"""Start/finish color code: events that START or are IN progress are
|
||||
yellow; events that COMPLETE are green. One glance = what stage,
|
||||
did it finish."""
|
||||
m = message.lower()
|
||||
"""Narration line color. Currently PLAIN WHITE for everything (user
|
||||
preference); flip the returns to 'yellow'/'green' to restore the
|
||||
start/finish coloring scheme."""
|
||||
return ''
|
||||
m = message.lower() # unreachable, kept for quick restore
|
||||
if any(k in m for k in ('complete', 'ready', 'downloaded', 'parsed',
|
||||
'restored', 'ok (')):
|
||||
return 'green'
|
||||
@ -215,7 +216,10 @@ def _print_phase(console, index, total, name, message):
|
||||
text = f'{prefix}{name}: {message}'
|
||||
color = _phase_color(message)
|
||||
if console is not None:
|
||||
console.print(f'[{color}]{text}[/{color}]', highlight=False)
|
||||
if color:
|
||||
console.print(f'[{color}]{text}[/{color}]', highlight=False)
|
||||
else:
|
||||
console.print(text, highlight=False)
|
||||
else:
|
||||
print(text, flush=True)
|
||||
|
||||
@ -493,7 +497,8 @@ def _cmd_eval_run(args) -> int:
|
||||
def _emit(msg, _i=i, _n=name):
|
||||
if _shared_reporter is not None:
|
||||
_col = _phase_color(msg)
|
||||
_shared_reporter.log(f'[{_col}][{_i + 1}/{total_runs}] {_n}: {msg}[/{_col}]')
|
||||
_line = f'[{_i + 1}/{total_runs}] {_n}: {msg}'
|
||||
_shared_reporter.log(f'[{_col}]{_line}[/{_col}]' if _col else _line)
|
||||
else:
|
||||
_print_phase(console, _i + 1, total_runs, _n, msg)
|
||||
|
||||
@ -531,7 +536,8 @@ def _cmd_eval_run(args) -> int:
|
||||
_tag = f'[{_idx}/{total_runs}] ' if total_runs > 1 else ''
|
||||
if _reporter is not None:
|
||||
_col = _phase_color(msg)
|
||||
_reporter.log(f'[{_col}]{_tag}{_name}: {msg}[/{_col}]')
|
||||
_line = f'{_tag}{_name}: {msg}'
|
||||
_reporter.log(f'[{_col}]{_line}[/{_col}]' if _col else _line)
|
||||
if 'scoring' in msg:
|
||||
_reporter.set_phase('scoring')
|
||||
elif 'generating model responses' in msg:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user