| |
| """Print results summary from eval JSON.""" |
| import json, sys |
|
|
| path = sys.argv[1] if len(sys.argv) > 1 else '/dev/shm/eval/results_a/full_results.json' |
| with open(path) as f: |
| data = json.load(f) |
|
|
| if 'results' not in data: |
| print("No results found!") |
| sys.exit(1) |
|
|
| scores = [] |
| for task, metrics in sorted(data['results'].items()): |
| found = False |
| for key in ['acc_norm', 'acc', 'f1', 'exact_match']: |
| |
| for k in [key, f'{key},none']: |
| if k in metrics: |
| val = metrics[k] |
| if isinstance(val, (int, float)): |
| print(f" {task}: {key} = {val:.4f} ({val*100:.2f}%)") |
| scores.append(val) |
| found = True |
| break |
| if found: |
| break |
| if not found: |
| |
| for k, v in metrics.items(): |
| if isinstance(v, (int, float)) and not k.startswith('alias'): |
| print(f" {task}: {k} = {v:.4f}") |
|
|
| if scores: |
| avg = sum(scores) / len(scores) |
| print(f"\n Average: {avg:.4f} ({avg*100:.2f}%)") |
| print(f" Baseline (IQ2_XXS): 61.34%") |
| print(f" FP16 Instruct: 65.71%") |
| if avg * 100 > 61.34: |
| print(f" >>> BEATS BASELINE by {avg*100 - 61.34:.2f}pp <<<") |
| else: |
| print(f" >>> Below baseline by {61.34 - avg*100:.2f}pp <<<") |
|
|