| |
| """Bootstrap local demo data for BizGenEval leaderboard development.""" |
|
|
| import json |
| from pathlib import Path |
|
|
|
|
| def write_json(path: Path, payload: dict): |
| path.parent.mkdir(parents=True, exist_ok=True) |
| path.write_text(json.dumps(payload, ensure_ascii=False, indent=2), encoding="utf-8") |
|
|
|
|
| def main(): |
| root = Path(__file__).resolve().parents[1] |
| queue_dir = root / "eval-queue" / "bizgeneval" / "requests" / "microsoft" |
| results_dir = root / "eval-results" / "bizgeneval" / "results" / "microsoft" / "Phi-4o-mini" |
|
|
| print("==============================================") |
| print(" BizGenEval Leaderboard - Local Data Bootstrap") |
| print("==============================================") |
| print(f"[1/3] Workspace: {root}") |
| print(f"[2/3] Queue dir: {queue_dir}") |
| print(f"[2/3] Result dir: {results_dir}") |
|
|
| request_payload = { |
| "project_id": "bizgeneval", |
| "model": "microsoft/Phi-4o-mini", |
| "base_model": "microsoft/Phi-4o-mini", |
| "revision": "main", |
| "precision": "float16", |
| "weight_type": "Original", |
| "status": "FINISHED", |
| "submitted_time": "2026-03-28T08:00:00Z", |
| "model_type": "🟢 : pretrained", |
| "likes": 314, |
| "params": 7.2, |
| "license": "mit", |
| "private": False, |
| } |
| request_path = queue_dir / "Phi-4o-mini_eval_request_False_float16_Original.json" |
| write_json(request_path, request_payload) |
| print(f"[OK] Wrote request: {request_path}") |
|
|
| summary_payload = { |
| "project_id": "bizgeneval", |
| "model_name": "microsoft/Phi-4o-mini", |
| "model_sha": "main", |
| "by_domain": { |
| "slides": {"error_score": 0.8125}, |
| "webpage": {"error_score": 0.8450}, |
| "poster": {"error_score": 0.7875}, |
| "chart": {"error_score": 0.8025}, |
| "scientific_figure": {"error_score": 0.7700}, |
| }, |
| "by_dimension": { |
| "layout": {"error_score": 0.8350}, |
| "attribute": {"error_score": 0.8050}, |
| "text": {"error_score": 0.7900}, |
| "knowledge": {"error_score": 0.7750}, |
| }, |
| } |
| summary_path = results_dir / "summary.json" |
| write_json(summary_path, summary_payload) |
| print(f"[OK] Wrote summary: {summary_path}") |
|
|
| print("[3/3] Done. You can now run:") |
| print(" LOCAL_DEV=1 python3 app.py") |
|
|
|
|
| if __name__ == "__main__": |
| main() |
|
|