Fix config override bug by recreating LMs after load_state
This commit is contained in:
@@ -23,7 +23,6 @@ MAGENTA = "\033[35m"
|
|||||||
|
|
||||||
# --- File operations ---
|
# --- File operations ---
|
||||||
|
|
||||||
|
|
||||||
def read_file(path: str, offset: int = 0, limit: int = None) -> str:
|
def read_file(path: str, offset: int = 0, limit: int = None) -> str:
|
||||||
"""Read file contents with line numbers.
|
"""Read file contents with line numbers.
|
||||||
|
|
||||||
@@ -164,6 +163,8 @@ def run_bash(cmd: str) -> str:
|
|||||||
return "".join(output_lines).strip() or "(empty output)"
|
return "".join(output_lines).strip() or "(empty output)"
|
||||||
|
|
||||||
|
|
||||||
|
# -- Program ---
|
||||||
|
|
||||||
class CodingAssistant(dspy.Signature):
|
class CodingAssistant(dspy.Signature):
|
||||||
"""You are a concise coding assistant with access to sub agents."""
|
"""You are a concise coding assistant with access to sub agents."""
|
||||||
|
|
||||||
@@ -270,6 +271,7 @@ class RLMCodingProgram(PrecompiledProgram):
|
|||||||
track_usage=self.config.track_usage,
|
track_usage=self.config.track_usage,
|
||||||
)
|
)
|
||||||
self.reload_repl()
|
self.reload_repl()
|
||||||
|
if os.getenv("MODAIC_ENV") == "dev":
|
||||||
print(f"{BLUE}LMs RELOADED: {self.lm.model}, {self.sub_lm.model}{RESET}")
|
print(f"{BLUE}LMs RELOADED: {self.lm.model}, {self.sub_lm.model}{RESET}")
|
||||||
|
|
||||||
def load_state(self, state):
|
def load_state(self, state):
|
||||||
|
|||||||
Reference in New Issue
Block a user