File size: 2,439 Bytes
1596349 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | #!/usr/bin/env python3
"""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()
|