Fix config override bug by recreating LMs after load_state

This commit is contained in:
2026-01-24 15:50:26 -08:00
parent 828d2887b4
commit a0492ff7c0

View File

@@ -170,8 +170,12 @@ def run_bash(cmd: str) -> str:
class RLMReasoningCallback(BaseCallback): class RLMReasoningCallback(BaseCallback):
def on_module_end(self, call_id, outputs, exception): def on_module_end(self, call_id, outputs, exception):
if outputs and hasattr(outputs, "reasoning") and hasattr(outputs, "code"): if outputs and hasattr(outputs, "reasoning") and hasattr(outputs, "code"):
has_backticks = "```" in outputs.code
print(f"{DIM}⏺ [REASONING STEP]\n{outputs.reasoning}\n{RESET}") print(f"{DIM}⏺ [REASONING STEP]\n{outputs.reasoning}\n{RESET}")
print(f"{DIM}⏺ [CODE]\n```\n{outputs.code}\n```\n{RESET}") if has_backticks:
print(f"{DIM}⏺ [CODE]\n{outputs.code}\n{RESET}")
else:
print(f"{DIM}⏺ [CODE]\n```\n{outputs.code}\n```\n{RESET}")
# -- Program --- # -- Program ---