mirror of
https://github.com/wassname/evil_MoE.git
synced 2026-09-09 11:22:16 +08:00
fix: drop stale RH_HINT_REPLACE_TO import that crashed the v_hack refresh path
regrade_pool imported RH_HINT_REPLACE_TO from train, but that scalar became the per-mode dict HINT_REPLACE_TO. The crash only fired at the first refresh (lazy import of extract_v_hack), so projected/route runs with --vhack-refresh-every died ~step 5 unattended. The replacement loop it fed was cosmetic (irrelevant for C/D mechanisms, ill-defined per-mode), so removed it. Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
This commit is contained in:
@@ -32,22 +32,18 @@ from loguru import logger
|
||||
from tabulate import tabulate
|
||||
|
||||
from .rewards import compute_reward
|
||||
from .train import DATA, RH_HINT_REPLACE_FROM, RH_HINT_REPLACE_TO # reuse dataset path constant
|
||||
from .train import DATA # reuse dataset path constant
|
||||
|
||||
|
||||
def load_problems_by_id() -> dict[int, dict]:
|
||||
# NB: we score against the bare prompt. The hint is now per-mode
|
||||
# (train.HINT_REPLACE_TO is a dict), and the C/D mechanisms don't read the
|
||||
# prompt anyway, so no single-string replacement is well-defined or needed.
|
||||
out = {}
|
||||
with DATA.open() as f:
|
||||
for idx, line in enumerate(f):
|
||||
d = json.loads(line)
|
||||
problem_id = d.get("id", idx)
|
||||
# Match train.py's text replacement so the prompt we score against
|
||||
# mirrors what the model saw at generation time. Irrelevant for
|
||||
# mechanism C/D (they don't read the prompt), but kept for symmetry.
|
||||
for m in d.get("prompt", []):
|
||||
if m.get("role") == "user":
|
||||
m["content"] = m["content"].replace(RH_HINT_REPLACE_FROM, RH_HINT_REPLACE_TO)
|
||||
break
|
||||
out[problem_id] = {
|
||||
"canonical_solution": d.get("canonical_solution", ""),
|
||||
"gt_tests": d["gt_answer"],
|
||||
|
||||
Reference in New Issue
Block a user