| """Generate configs/folds/fold_{0..9}.json — byte-identical to the flagship config |
| except name and out_dir. Data paths are NOT in the config: each fold job exports |
| STOICHEIA_DATA_ROOT=$STOICHEIA_DATA/folds/fold_k so stage_shards.sh points STOICHEIA_DATA at the fold.""" |
| import json |
| from pathlib import Path |
|
|
| root = Path(__file__).resolve().parents[2] |
| base = json.load(open(root / "configs" / "pretrain" / "stoicheia.json")) |
| out = root / "configs" / "pretrain" / "folds" |
| out.mkdir(parents=True, exist_ok=True) |
| for k in range(10): |
| c = dict(base) |
| c["name"] = f"stoicheia_fold_{k}" |
| c["out_dir"] = f"$STOICHEIA_DATA/runs/stoicheia_fold_{k}" |
| |
| |
| c["eval_shards"] = f"$STOICHEIA_DATA/folds/fold_{k}/val_shards/v1_punct" |
| c["train_holdout"] = False |
| |
| |
| |
| c["hard_max_steps"] = 1000000 |
| c["decay_frac"] = 0.4 |
| |
| |
| |
| c["anneal_phases"] = [[0.5, [1.0, 1.0, 0.3]], [0.9, [1.0, 1.0, 0.0]], |
| [1.0, [1.0, 0.0, 0.0]]] |
| json.dump(c, open(out / f"fold_{k}.json", "w"), indent=2) |
| print(out / f"fold_{k}.json") |
|
|