Skip to content

Commit

Permalink
fix: kaggle data mount problem (#297)
Browse files Browse the repository at this point in the history
* fix kaggle data founding in feature running

* fix CI
  • Loading branch information
XianBW authored Sep 23, 2024
1 parent 91a6196 commit 795df31
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions rdagent/scenarios/kaggle/experiment/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ def generate_preprocess_data(
"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.")
Expand Down
9 changes: 7 additions & 2 deletions rdagent/utils/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,12 @@ def run(
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.
Expand All @@ -330,7 +335,7 @@ def dump_python_code_run_and_get_results(
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:
Expand Down

0 comments on commit 795df31

Please sign in to comment.