diff --git a/rdagent/scenarios/kaggle/experiment/workspace.py b/rdagent/scenarios/kaggle/experiment/workspace.py index 7a0e9299..30992d44 100644 --- a/rdagent/scenarios/kaggle/experiment/workspace.py +++ b/rdagent/scenarios/kaggle/experiment/workspace.py @@ -48,6 +48,11 @@ class KGFBWorkspace(FBWorkspace): "X_test.pkl", "passenger_ids.pkl", ], + running_extra_volume=( + {KAGGLE_IMPLEMENT_SETTING.local_data_path + "/" + KAGGLE_IMPLEMENT_SETTING.competition: "/kaggle/input"} + if KAGGLE_IMPLEMENT_SETTING.competition + else None + ), ) if results is None: logger.error("Feature preprocess failed.") diff --git a/rdagent/utils/env.py b/rdagent/utils/env.py index 85cca343..7c43d743 100644 --- a/rdagent/utils/env.py +++ b/rdagent/utils/env.py @@ -321,7 +321,12 @@ class DockerEnv(Env[DockerConf]): raise RuntimeError(f"Error while running the container: {e}") def dump_python_code_run_and_get_results( - self, code: str, dump_file_names: list[str], local_path: str | None = None, env: dict | None = None + self, + code: str, + dump_file_names: list[str], + local_path: str | None = None, + env: dict | None = None, + running_extra_volume: dict | None = None, ): """ Dump the code into the local path and run the code. @@ -330,7 +335,7 @@ class DockerEnv(Env[DockerConf]): with open(os.path.join(local_path, random_file_name), "w") as f: f.write(code) entry = f"python {random_file_name}" - log_output = self.run(entry, local_path, env) + log_output = self.run(entry, local_path, env, running_extra_volume=running_extra_volume) results = [] os.remove(os.path.join(local_path, random_file_name)) for name in dump_file_names: