fix restart bug (#609)

This commit is contained in:
Xu Yang
2025-02-18 15:39:34 +08:00
committed by GitHub
parent 9fcd5d473e
commit 75e496d461
2 changed files with 7 additions and 4 deletions
+7 -2
View File
@@ -125,9 +125,14 @@ class DataScienceRDLoop(RDLoop):
)
if self.trace.sota_experiment() is None and len(self.trace.hist) >= DS_RD_SETTING.consecutive_errors:
trace_exp_next_component_list = [
exp.next_component_required() for exp, _ in self.trace.hist[-DS_RD_SETTING.consecutive_errors :]
type(exp.pending_tasks_list[0][0])
for exp, _ in self.trace.hist[-DS_RD_SETTING.consecutive_errors :]
]
if None not in trace_exp_next_component_list and len(set(trace_exp_next_component_list)) == 1:
last_successful_exp = self.trace.last_successful_exp()
if (
last_successful_exp not in [exp for exp, _ in self.trace.hist[-DS_RD_SETTING.consecutive_errors :]]
and len(set(trace_exp_next_component_list)) == 1
):
logger.error("Consecutive errors reached the limit. Dumping trace.")
logger.log_object(self.trace, tag="trace before restart")
self.trace = DSTrace(scen=self.trace.scen, knowledge_base=self.trace.knowledge_base)
@@ -11,8 +11,6 @@ from rdagent.oai.llm_utils import md5_hash
from rdagent.utils.agent.tpl import T
from rdagent.utils.env import DockerEnv, DSDockerConf
DataLoaderTask = CoSTEERTask
# Because we use isinstance to distinguish between different types of tasks, we need to use sub classes to represent different types of tasks
class DataLoaderTask(CoSTEERTask):