42e commited on
Commit
e036bbf
·
verified ·
1 Parent(s): 6f2d0b4

Upload folder using huggingface_hub

Browse files
src/mathcompose/eval/prmbench.py CHANGED
@@ -106,7 +106,7 @@ def evaluate_batched(
106
 
107
  ds = load_dataset(dataset_id, split=split)
108
  if limit is not None:
109
- ds = ds.select(range(min(limit, len(ds))))
110
 
111
  mod_items, mod_gold, mod_cat = [], [], []
112
  orig_items = []
 
106
 
107
  ds = load_dataset(dataset_id, split=split)
108
  if limit is not None:
109
+ ds = ds.shuffle(seed=0).select(range(min(limit, len(ds))))
110
 
111
  mod_items, mod_gold, mod_cat = [], [], []
112
  orig_items = []
src/mathcompose/eval/processbench.py CHANGED
@@ -135,7 +135,8 @@ def evaluate_batched(
135
  for split in splits:
136
  ds = load_dataset(dataset_id, split=split)
137
  if limit is not None:
138
- ds = ds.select(range(min(limit, len(ds))))
 
139
  items = [(row["problem"], list(row["steps"])) for row in ds]
140
  golds = [int(row["label"]) for row in ds]
141
  preds = verify_batch_predictions(
 
135
  for split in splits:
136
  ds = load_dataset(dataset_id, split=split)
137
  if limit is not None:
138
+ # shuffle first: ProcessBench splits are ordered, so first-N is class-biased
139
+ ds = ds.shuffle(seed=0).select(range(min(limit, len(ds))))
140
  items = [(row["problem"], list(row["steps"])) for row in ds]
141
  golds = [int(row["label"]) for row in ds]
142
  preds = verify_batch_predictions(
src/mathcompose/train/colab_train.ipynb CHANGED
@@ -16,9 +16,11 @@
16
  "execution_count": null,
17
  "outputs": [],
18
  "source": [
19
- "# 1. GPU deps (+ 4-bit kernels)\n",
 
20
  "!pip -q install \"transformers>=5.13,<6\" \"trl>=1.7,<2\" \"peft>=0.19,<0.20\" \\\n",
21
- " \"accelerate>=1.14\" \"datasets>=5.0\" \"huggingface_hub>=1.22\" sympy bitsandbytes"
 
22
  ]
23
  },
24
  {
@@ -69,9 +71,8 @@
69
  "cell_type": "markdown",
70
  "metadata": {},
71
  "source": [
72
- "## 5. Eval V on ProcessBench \u2014 base vs tuned (now batched \u2192 fast)\n",
73
- "Fast first read below (1 split, small limit, Maj@4). For the headline number,\n",
74
- "drop `--splits`/raise `--limit` and use `--maj-k 8`."
75
  ]
76
  },
77
  {
@@ -80,10 +81,9 @@
80
  "execution_count": null,
81
  "outputs": [],
82
  "source": [
83
- "# fast sanity read (~a few min on A100):\n",
84
  "!python -m mathcompose.eval.run processbench --tag base --maj-k 1 --limit 100 --splits gsm8k\n",
85
  "!python -m mathcompose.eval.run processbench --adapter runs/verifier_v --tag tuned --maj-k 4 --limit 100 --splits gsm8k\n",
86
- "# full run (all 4 splits, Maj@8) \u2014 uncomment when the fast read looks right:\n",
87
  "# !python -m mathcompose.eval.run processbench --tag base --maj-k 1\n",
88
  "# !python -m mathcompose.eval.run processbench --adapter runs/verifier_v --tag tuned --maj-k 8\n",
89
  "!python -m mathcompose.eval.run prmbench --adapter runs/verifier_v --tag tuned --maj-k 1 --limit 200\n",
@@ -114,8 +114,7 @@
114
  "cell_type": "markdown",
115
  "metadata": {},
116
  "source": [
117
- "## 7. (Later) Model G + composition\n",
118
- "Build G's dataset (teacher=claude-opus-4-8), train, then V-reranks-G."
119
  ]
120
  },
121
  {
 
16
  "execution_count": null,
17
  "outputs": [],
18
  "source": [
19
+ "# 1. GPU deps (+ 4-bit kernels). Remove Colab's incompatible torchao (breaks PEFT\n",
20
+ "# adapter loading; unused by our QLoRA/LoRA path).\n",
21
  "!pip -q install \"transformers>=5.13,<6\" \"trl>=1.7,<2\" \"peft>=0.19,<0.20\" \\\n",
22
+ " \"accelerate>=1.14\" \"datasets>=5.0\" \"huggingface_hub>=1.22\" sympy bitsandbytes\n",
23
+ "!pip -q uninstall -y torchao 2>/dev/null; echo \"torchao removed (ok if it was absent)\""
24
  ]
25
  },
26
  {
 
71
  "cell_type": "markdown",
72
  "metadata": {},
73
  "source": [
74
+ "## 5. Eval V on ProcessBench \u2014 base vs tuned (batched; limited slices are sampled randomly)\n",
75
+ "Fast first read (1 split, Maj@4). For the headline, drop `--splits`/`--limit`, use `--maj-k 8`."
 
76
  ]
77
  },
78
  {
 
81
  "execution_count": null,
82
  "outputs": [],
83
  "source": [
 
84
  "!python -m mathcompose.eval.run processbench --tag base --maj-k 1 --limit 100 --splits gsm8k\n",
85
  "!python -m mathcompose.eval.run processbench --adapter runs/verifier_v --tag tuned --maj-k 4 --limit 100 --splits gsm8k\n",
86
+ "# full run when the fast read looks right:\n",
87
  "# !python -m mathcompose.eval.run processbench --tag base --maj-k 1\n",
88
  "# !python -m mathcompose.eval.run processbench --adapter runs/verifier_v --tag tuned --maj-k 8\n",
89
  "!python -m mathcompose.eval.run prmbench --adapter runs/verifier_v --tag tuned --maj-k 1 --limit 200\n",
 
114
  "cell_type": "markdown",
115
  "metadata": {},
116
  "source": [
117
+ "## 7. (Later) Model G + composition"
 
118
  ]
119
  },
120
  {