Skip to content

Commit 4e53108

Browse files
authored
fix: adjust ds_trace lookup and add stderr redirect to mlebench command (microsoft#853)
* fix: adjust ds_trace lookup and add stderr redirect to mlebench command * style: reformat SOTA experiment lookup in ds_trace.py * feat: add DS_RD_SETTING pipeline to MergeExpGen success message
1 parent 32cdc57 commit 4e53108

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

rdagent/log/ui/ds_trace.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,11 @@ def main_win(loop_id, llm_data=None):
397397
loop_data["running"],
398398
loop_data.get("mle_score", "no submission to score"),
399399
llm_data=llm_data["running"] if llm_data else None,
400-
sota_exp=state.data[loop_id - 1].get("record", {}).get("SOTA experiment", None) if loop_id >= 1 else None,
400+
sota_exp=(
401+
state.data[loop_id - 1].get("record", {}).get("SOTA experiment", None)
402+
if (loop_id - 1) in state.data
403+
else None
404+
),
401405
)
402406
if "feedback" in loop_data:
403407
feedback_win(loop_data["feedback"], llm_data.get("feedback", None) if llm_data else None)

rdagent/scenarios/data_science/proposal/exp_gen/merge.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Merge the version in different traces"""
22

3+
from rdagent.app.data_science.conf import DS_RD_SETTING
34
from rdagent.components.coder.data_science.pipeline.exp import PipelineTask
45
from rdagent.core.proposal import ExpGen
56
from rdagent.scenarios.data_science.experiment.experiment import DSExperiment
@@ -46,6 +47,7 @@ def gen(self, trace: DSTrace, selection: tuple[int, ...] = (-1,)) -> DSExperimen
4647
type="success",
4748
heading="Successful iterations:",
4849
success_trial_desc="These trials are the steps or changes that led to the success of the solution to be merged",
50+
pipeline=DS_RD_SETTING.coder_on_whole_pipeline,
4951
)
5052
else:
5153
exp_to_merge_fb_desc = T("scenarios.data_science.share:describe.feedback").r(

rdagent/scenarios/data_science/test_eval.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ def __init__(self) -> None:
103103
def eval(self, competition: str, workspace: FBWorkspace) -> str:
104104
workspace.execute(
105105
env=self.env,
106-
entry=f"mlebench grade-sample submission.csv {competition} --data-dir /mle/data | tee mle_score.txt",
106+
entry=f"mlebench grade-sample submission.csv {competition} --data-dir /mle/data 2>&1 | tee mle_score.txt",
107+
# NOTE: mlebench does not give output to stdout. so 2>&1 is very necessary !!!!!!
107108
)
108109
workspace.execute(env=self.env, entry="chmod 777 mle_score.txt")
109110
return (workspace.workspace_path / "mle_score.txt").read_text()

0 commit comments

Comments
 (0)