Download tests/test_benchmark.py from maxffarrell/gtcrn-coreai: direct link, hf CLI and curl.
- Browser
- Download file 424 Bytes
-
https://huggingface.co/maxffarrell/gtcrn-coreai/resolve/main/tests/test_benchmark.py
- Command line
-
hf download hf://maxffarrell/gtcrn-coreai/tests/test_benchmark.py
-
curl -L -o test_benchmark.py https://huggingface.co/maxffarrell/gtcrn-coreai/resolve/main/tests/test_benchmark.py
424 Bytes
| from __future__ import annotations | |
| import pytest | |
| from gtcrn_coreai.benchmark import summarize_latencies | |
| def test_summarize_latencies() -> None: | |
| result = summarize_latencies([1.0, 2.0, 3.0, 4.0]) | |
| assert result["mean_ms"] == pytest.approx(2.5) | |
| assert result["p50_ms"] == pytest.approx(2.5) | |
| assert result["max_ms"] == pytest.approx(4.0) | |
| assert result["realtime_ratio_mean"] == pytest.approx(2.5 / 16.0) | |