Datasets:
Download scripts/rescore_checkpoint.py from iulio/plc-llm-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.32 kB
-
https://huggingface.co/datasets/iulio/plc-llm-bench/resolve/main/scripts/rescore_checkpoint.py
- Command line
-
hf download hf://datasets/iulio/plc-llm-bench/scripts/rescore_checkpoint.py
-
curl -L -o rescore_checkpoint.py https://huggingface.co/datasets/iulio/plc-llm-bench/resolve/main/scripts/rescore_checkpoint.py
1.32 kB
| """Standalone CLI wrapper for re-scoring an existing checkpoint JSONL and regenerating reports.""" | |
| from __future__ import annotations | |
| import argparse | |
| import pathlib | |
| import sys | |
| _ROOT = pathlib.Path(__file__).resolve().parents[1] | |
| if str(_ROOT) not in sys.path: | |
| sys.path.insert(0, str(_ROOT)) | |
| from plc_bench.report import generate_reports | |
| from plc_bench.runner import rescore_checkpoint | |
| def main() -> None: | |
| parser = argparse.ArgumentParser(description="Re-score checkpoint.jsonl with the v0.2 transpiler/simulator.") | |
| parser.add_argument("checkpoint", type=pathlib.Path, help="Path to existing checkpoint.jsonl") | |
| parser.add_argument("--out-ckpt", type=pathlib.Path, default=None, help="Optional destination JSONL path") | |
| parser.add_argument("--out-dir", type=pathlib.Path, default=None, help="Directory for leaderboard.md & summary.json") | |
| args = parser.parse_args() | |
| rescored = rescore_checkpoint(args.checkpoint, out_path=args.out_ckpt) | |
| final_ckpt = args.out_ckpt or args.checkpoint | |
| report_dir = args.out_dir or final_ckpt.parent | |
| md_path, json_path, png_path = generate_reports(final_ckpt, report_dir) | |
| print(f"Rescored {len(rescored)} records -> {final_ckpt}") | |
| print(f"Reports written:\n {md_path}\n {json_path}\n {png_path}") | |
| if __name__ == "__main__": | |
| main() | |