feat: QLoRA fine-tune v1 on M5 + fused model (M2)

This commit is contained in:
marcuspaico
2026-08-17 13:43:32 -07:00
parent d55d9a648c
commit 7a30e06ab0
2 changed files with 28 additions and 0 deletions

12
scripts/prepare_train.py Normal file
View File

@@ -0,0 +1,12 @@
import json, random
from pathlib import Path
rows = [json.loads(l) for l in Path("data/instructions.jsonl").read_text().splitlines()]
random.seed(7); random.shuffle(rows)
n_val = max(200, len(rows) // 20)
Path("data/train").mkdir(parents=True, exist_ok=True)
for name, part in [("valid", rows[:n_val]), ("train", rows[n_val:])]:
with Path(f"data/train/{name}.jsonl").open("w") as f:
for r in part:
f.write(json.dumps(r) + "\n")
print(len(rows) - n_val, "train /", n_val, "valid")