Skip to content

Commit

Permalink
add file filter in FBworkspace.code property
Browse files Browse the repository at this point in the history
  • Loading branch information
XianBW committed Dec 27, 2024
1 parent 36b4191 commit 34aa750
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rdagent/components/coder/data_science/model/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def evaluate(
ds_docker_conf = DSDockerConf()
ds_docker_conf.extra_volumes = {f"{DS_RD_SETTING.local_data_path}/{self.scen.competition}": "/kaggle/input"}
de = DockerEnv(conf=ds_docker_conf)
fname = "model_execute.py"
with (DIRNAME / "eval_tests" / "model_execute.py").open("r") as f:
fname = "model_test.py"
with (DIRNAME / "eval_tests" / fname).open("r") as f:
test_code = f.read()
implementation.inject_files(**{fname: test_code})
stdout = implementation.execute(env=de, entry=f"python {fname}")
Expand Down
3 changes: 2 additions & 1 deletion rdagent/core/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
def code(self) -> str:
code_string = ""
for file_name, code in self.file_dict.items():
code_string += f"File: {file_name}\n{code}\n"
if file_name.endswith(".py") and 'test' not in file_name:
code_string += f"File: {file_name}\n{code}\n"
return code_string

def prepare(self) -> None:
Expand Down

0 comments on commit 34aa750

Please sign in to comment.