Add reload_lms method and debug forward()
This commit is contained in:
@@ -221,6 +221,7 @@ class RLMCodingProgram(PrecompiledProgram):
|
|||||||
verbose=self.config.verbose,
|
verbose=self.config.verbose,
|
||||||
)
|
)
|
||||||
self.agent.set_lm(self.lm)
|
self.agent.set_lm(self.lm)
|
||||||
|
self.set_lm(self.lm)
|
||||||
print(f"{BLUE}CONFIG WAS SET: {self.config}{RESET}")
|
print(f"{BLUE}CONFIG WAS SET: {self.config}{RESET}")
|
||||||
print(f"{BLUE}LM WAS SET: {self.agent.get_lm().model}{RESET}")
|
print(f"{BLUE}LM WAS SET: {self.agent.get_lm().model}{RESET}")
|
||||||
print(f"{BLUE}SUB LM WAS SET: {self.agent.sub_lm.model}{RESET}")
|
print(f"{BLUE}SUB LM WAS SET: {self.agent.sub_lm.model}{RESET}")
|
||||||
@@ -229,13 +230,11 @@ class RLMCodingProgram(PrecompiledProgram):
|
|||||||
if not task:
|
if not task:
|
||||||
return dspy.Prediction(answer="No Task Given.")
|
return dspy.Prediction(answer="No Task Given.")
|
||||||
|
|
||||||
# Debug: verify LM at call time
|
print(f"{YELLOW}DEBUG forward() - agent.get_lm().model: {self.agent.get_lm().model}{RESET}")
|
||||||
actual_lm = self.agent.get_lm()
|
|
||||||
print(f"{YELLOW}DEBUG forward() - agent.get_lm().model: {actual_lm.model}{RESET}")
|
|
||||||
print(f"{YELLOW}DEBUG forward() - self.lm.model: {self.lm.model}{RESET}")
|
print(f"{YELLOW}DEBUG forward() - self.lm.model: {self.lm.model}{RESET}")
|
||||||
print(f"{YELLOW}DEBUG forward() - agent.sub_lm.model: {self.agent.sub_lm.model}{RESET}")
|
print(f"{YELLOW}DEBUG forward() - agent.sub_lm.model: {self.agent.sub_lm.model}{RESET}")
|
||||||
print(f"{YELLOW}DEBUG forward() - self.sub_lm.model: {self.sub_lm.model}{RESET}")
|
print(f"{YELLOW}DEBUG forward() - self.sub_lm.model: {self.sub_lm.model}{RESET}")
|
||||||
print(f"{YELLOW}DEBUG forward() - id(agent.get_lm()): {id(actual_lm)}, id(self.lm): {id(self.lm)}{RESET}")
|
print(f"{YELLOW}DEBUG forward() - id(agent.get_lm()): {id(self.agent.get_lm())}, id(self.lm): {id(self.lm)}{RESET}")
|
||||||
|
|
||||||
return self.agent(task=task)
|
return self.agent(task=task)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user