Download code/scripts/collect_evals.py from KeremTT/OPUS-5.5-DATABASE: direct link, hf CLI and curl.
- Browser
- Download file 1.32 kB
-
https://huggingface.co/datasets/KeremTT/OPUS-5.5-DATABASE/resolve/main/code/scripts/collect_evals.py
- Command line
-
hf download hf://datasets/KeremTT/OPUS-5.5-DATABASE/code/scripts/collect_evals.py
-
curl -L -o collect_evals.py https://huggingface.co/datasets/KeremTT/OPUS-5.5-DATABASE/resolve/main/code/scripts/collect_evals.py
1.32 kB
| """Collect eval_synth.py outputs (out/evals/*.json) into out/stats/evals.json for charts and the card.""" | |
| import glob | |
| import json | |
| import os | |
| OUT = os.environ.get("OPUSDB_OUT", "out") | |
| META = { # file stem -> (label, params in billions, kind, base model, train examples, note) | |
| "smollm2-135m": ("SmolLM2-135M-Instruct", 0.135, "baseline", None, 0, ""), | |
| "SmolLM2-360M-Instruct": ("SmolLM2-360M-Instruct", 0.36, "baseline", None, 0, ""), | |
| "Qwen2.5-0.5B-Instruct": ("Qwen2.5-0.5B-Instruct", 0.5, "baseline", None, 0, ""), | |
| "Qwen2.5-1.5B-Instruct": ("Qwen2.5-1.5B-Instruct", 1.5, "baseline", None, 0, ""), | |
| "smollm2-135m-opus": ("SmolLM2-135M-Instruct + OPUS-SFT", 0.135, "opus-sft", "HuggingFaceTB/SmolLM2-135M-Instruct", | |
| 4000, "1 epoch on `opus-synth` rows, CPU, lr 1e-4"), | |
| } | |
| rows = [] | |
| for f in sorted(glob.glob(os.path.join(OUT, "evals", "*.json"))): | |
| stem = os.path.basename(f)[:-5] | |
| if stem not in META: | |
| continue | |
| s = json.load(open(f))["summary"] | |
| label, p, kind, base, n_train, note = META[stem] | |
| rows.append({**s, "label": label, "params_b": p, "kind": kind, "base_model": base, "train_examples": n_train, | |
| "train_note": note}) | |
| json.dump(rows, open(os.path.join(OUT, "stats", "evals.json"), "w"), indent=2) | |
| print(len(rows), "eval rows") | |