Datasets:
Modalities:
Text
Formats:
json
Languages:
English
Size:
< 1K
Tags:
reinforcement-learning
policy-optimization
klpo
exact-moment-replay
score-centering
stratified-sampling
License:
Download tests/test_examples.py from PureOne/Celestis-RL: direct link, hf CLI and curl.
- Browser
- Download file 675 Bytes
-
https://huggingface.co/datasets/PureOne/Celestis-RL/resolve/main/tests/test_examples.py
- Command line
-
hf download hf://datasets/PureOne/Celestis-RL/tests/test_examples.py
-
curl -L -o test_examples.py https://huggingface.co/datasets/PureOne/Celestis-RL/resolve/main/tests/test_examples.py
675 Bytes
| import json | |
| from pathlib import Path | |
| import runpy | |
| def test_certified_update_example(capsys): | |
| root=Path(__file__).resolve().parents[1] | |
| runpy.run_path(str(root/"examples/certified_update.py"),run_name="__main__") | |
| result=json.loads(capsys.readouterr().out) | |
| assert result["accepted"] | |
| assert result["audit"]["lower_gain_bound"]>0 | |
| assert result["confidence_attempts"]==1 | |
| def test_data_schema(): | |
| root=Path(__file__).resolve().parents[1] | |
| rows=[json.loads(s) for s in (root/"data/exact_match_prompts.jsonl").read_text().splitlines()] | |
| assert len(rows)==4 | |
| assert all(isinstance(x["prompt"],str) and isinstance(x["answer"],str) for x in rows) | |