Spaces:
Runtime error
Runtime error
Download tests/test_reporting.py from bhargob11/llm-eval-framework: direct link, hf CLI and curl.
- Browser
- Download file 791 Bytes
-
https://huggingface.co/spaces/bhargob11/llm-eval-framework/resolve/main/tests/test_reporting.py
- Command line
-
hf download hf://spaces/bhargob11/llm-eval-framework/tests/test_reporting.py
-
curl -L -o test_reporting.py https://huggingface.co/spaces/bhargob11/llm-eval-framework/resolve/main/tests/test_reporting.py
791 Bytes
| from llm_eval.reporting import build_markdown_report | |
| def test_markdown_report_contains_sections() -> None: | |
| scored = { | |
| "status": "completed", | |
| "total_rows": 4, | |
| "providers": { | |
| "anthropic": { | |
| "attempted": 2, | |
| "correct": 2, | |
| "accuracy": 1.0, | |
| "avg_latency_ms": 123.0, | |
| "errors": 0, | |
| "accuracy_ci95": {"low": 0.34, "high": 1.0}, | |
| "categories": {"math": {"attempted": 2, "correct": 2, "accuracy": 1.0}}, | |
| } | |
| }, | |
| } | |
| pairwise = [] | |
| report = build_markdown_report("run123", scored, pairwise) | |
| assert "# Evaluation Report: run123" in report | |
| assert "## Leaderboard" in report | |
| assert "## Category Breakdown" in report | |