Fix config override bug by recreating LMs after load_state
This commit is contained in:
@@ -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 ---
|
||||||
|
|||||||
Reference in New Issue
Block a user