Write benchmark results to a CSV file.
(results: list[dict], path: Path)
| 119 | |
| 120 | |
| 121 | def write_csv(results: list[dict], path: Path) -> None: |
| 122 | """Write benchmark results to a CSV file.""" |
| 123 | if not results: |
| 124 | return |
| 125 | path.parent.mkdir(parents=True, exist_ok=True) |
| 126 | fieldnames = list(results[0].keys()) |
| 127 | with open(path, "w", newline="") as f: |
| 128 | writer = csv.DictWriter(f, fieldnames=fieldnames) |
| 129 | writer.writeheader() |
| 130 | writer.writerows(results) |
| 131 | |
| 132 | |
| 133 | def run_eval( |
no outgoing calls