diff --git a/evalharness/cli.py b/evalharness/cli.py index f040b13..ad78878 100644 --- a/evalharness/cli.py +++ b/evalharness/cli.py @@ -445,8 +445,6 @@ def _cmd_eval_run(args) -> int: from pathlib import Path Path(out_dir).mkdir(parents=True, exist_ok=True) - (Path(out_dir) / 'viz').mkdir(exist_ok=True) - (Path(out_dir) / 'reports').mkdir(exist_ok=True) rows = [] all_reports = [] @@ -463,8 +461,6 @@ def _cmd_eval_run(args) -> int: from pathlib import Path Path(out_dir).mkdir(parents=True, exist_ok=True) - (Path(out_dir) / 'viz').mkdir(exist_ok=True) - (Path(out_dir) / 'reports').mkdir(exist_ok=True) console = _rich_console() _print_run_plan(console, args, model_spec) for i, name in enumerate(args.datasets): @@ -523,9 +519,13 @@ def _cmd_eval_run(args) -> int: report.save(args.out) if out_dir: _print_phase(console, i + 1, total_runs, name, - 'writing report and visualization files') - report.save(f'{out_dir}/reports/{name}.report.json') - with open(f'{out_dir}/viz/{name}.md', 'w', encoding='utf-8') as f: + 'writing results') + from pathlib import Path as _P + + bench_dir = _P(out_dir) / name + bench_dir.mkdir(parents=True, exist_ok=True) + report.save(str(bench_dir / 'report.json')) + with open(bench_dir / 'detail.md', 'w', encoding='utf-8') as f: f.write(render(report, style='md')) if args.verbose: if not _print_result_panel(console, report, _time.time() - t0): @@ -583,7 +583,7 @@ def _cmd_eval_run(args) -> int: from evalharness.viz import render as _render xb = _render(all_reports, style='excel', - out=f'{out_dir}/viz/results.xlsx') + out=f'{out_dir}/summary.xlsx') print(f'excel -> {xb}', flush=True) except Exception as e: print(f'excel export skipped: {type(e).__name__}: {str(e)[:80]}', @@ -593,7 +593,7 @@ def _cmd_eval_run(args) -> int: if out_dir: import csv as _csv - with open(f'{out_dir}/viz/summary.csv', 'w', newline='', encoding='utf-8') as f: + with open(f'{out_dir}/summary.csv', 'w', newline='', encoding='utf-8') as f: w = _csv.writer(f) w.writerow(['benchmark', 'score', 'metric', 'num_samples', 'time_h', 'time_s', 'extract_fail', @@ -618,7 +618,7 @@ def _cmd_eval_run(args) -> int: 'ttft_mean_s', 'ttft_p90_s', 'ttft_p99_s', 'tpot_mean_s', 'tpot_p90_s', 'tpot_p99_s')] + [cats]) - with open(f'{out_dir}/viz/summary.md', 'w', encoding='utf-8') as f: + with open(f'{out_dir}/summary.md', 'w', encoding='utf-8') as f: import time as _tt model_names = {r.get('model', '') for r in rows if r.get('model')} head = f"# eval run summary\n\n- model: {', '.join(model_names) or '?'}\n" @@ -648,13 +648,13 @@ def _cmd_eval_run(args) -> int: console.print( f'\n{mark} [bold]运行结束[/bold] · {ok_n}/{len(rows)} benchmarks ok\n' f' 结果 {ap}\n' - f' ├─ reports/.report.json\n' - f' ├─ viz/results.xlsx (excel 打开)\n' - f' └─ viz/summary.md (+ summary.csv)') + f' ├─ summary.xlsx (excel 打开总表)\n' + f' ├─ summary.md / summary.csv\n' + f' └─ /report.json + detail.md (每 benchmark 一个目录)') else: print(f'\n运行结束 · {ok_n}/{len(rows)} benchmarks ok\n' - f' 结果 {ap}\n ├─ reports/.report.json\n' - f' ├─ viz/results.xlsx\n └─ viz/summary.md') + f' 结果 {ap}\n' + f' ├─ summary.xlsx\n └─ /report.json + detail.md') elif rows and rows[0]['ok'] and args.out: _notice('运行结束 · 结果已保存', args.out) print(f'{ok_n}/{len(rows)} benchmarks ok')