Download scripts/yans/lm-evaluation-harness/tests/test_misc.py from koichi12/llm-scripts: direct link, hf CLI and curl.
- Browser
- Download file 344 Bytes
-
https://huggingface.co/koichi12/llm-scripts/resolve/main/scripts/yans/lm-evaluation-harness/tests/test_misc.py
- Command line
-
hf download hf://koichi12/llm-scripts/scripts/yans/lm-evaluation-harness/tests/test_misc.py
-
curl -L -o test_misc.py https://huggingface.co/koichi12/llm-scripts/resolve/main/scripts/yans/lm-evaluation-harness/tests/test_misc.py
344 Bytes
| import random | |
| import pytest | |
| import lm_eval.api.metrics as metrics | |
| def test_bootstrapping(): | |
| random.seed(42) | |
| arr = [random.random() for _ in range(1000)] | |
| expected = metrics.mean_stderr(arr) | |
| bootstrapped = metrics.bootstrap_stderr(metrics.mean, arr, iters=100000) | |
| assert bootstrapped == pytest.approx(expected, abs=1e-4) | |