File size: 1,322 Bytes
73f7e6f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | """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")
|