cleanup: consolidate stale loaders and pair scripts

This commit is contained in:
wassname
2026-06-09 12:47:32 +00:00
parent ca8d1adf62
commit 438068c431
14 changed files with 92 additions and 914 deletions
+6 -4
View File
@@ -28,8 +28,8 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
from vgrout.antipasto import wrap_model_with_antipasto
from vgrout.extract_vhack_grad import completion_nll, resolve_dtype
from vgrout.pairs import PAIRS
from vgrout.extract_vhack_grad import load_v_hack
from vgrout.pairs_from_pool import load_pairs_json
from vgrout.vhack import load_v_hack
CACHE_ROOT = Path("svd_cache")
@@ -42,6 +42,7 @@ class Config:
dtype: str = "bf16" # must match extract_vhack_grad.py and train.py
v_hack_path: Path = OUT_DIR / "vhack" / "v_hack_rh25.safetensors"
out_path: Path = OUT_DIR / "vhack_heldout_cos_rh25.safetensors"
pairs_path: Path = OUT_DIR / "pairsets" / "prog_wide.json"
n_heldout: int = 2
@@ -50,8 +51,9 @@ def main(cfg: Config) -> int:
dtype = resolve_dtype(cfg.dtype)
logger.info(f"device={device} model={cfg.model} dtype={cfg.dtype}")
held = PAIRS[-cfg.n_heldout:]
logger.info(f"held-out pairs: {len(held)}")
pairs = load_pairs_json(cfg.pairs_path)
held = pairs[-cfg.n_heldout:]
logger.info(f"held-out pairs: {len(held)} from {cfg.pairs_path}")
tokenizer = AutoTokenizer.from_pretrained(cfg.model)
model = AutoModelForCausalLM.from_pretrained(