Skip to content

Commit 157c8b8

Browse files
XianBWWinstonLiyt
authored andcommitted
fix: kaggle data mount problem (#297)
* fix kaggle data founding in feature running * fix CI
1 parent c89feac commit 157c8b8

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

rdagent/scenarios/kaggle/experiment/workspace.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ def generate_preprocess_data(
4848
"X_test.pkl",
4949
"passenger_ids.pkl",
5050
],
51+
running_extra_volume=(
52+
{KAGGLE_IMPLEMENT_SETTING.local_data_path + "/" + KAGGLE_IMPLEMENT_SETTING.competition: "/kaggle/input"}
53+
if KAGGLE_IMPLEMENT_SETTING.competition
54+
else None
55+
),
5156
)
5257
if results is None:
5358
logger.error("Feature preprocess failed.")

rdagent/utils/env.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,12 @@ def run(
321321
raise RuntimeError(f"Error while running the container: {e}")
322322

323323
def dump_python_code_run_and_get_results(
324-
self, code: str, dump_file_names: list[str], local_path: str | None = None, env: dict | None = None
324+
self,
325+
code: str,
326+
dump_file_names: list[str],
327+
local_path: str | None = None,
328+
env: dict | None = None,
329+
running_extra_volume: dict | None = None,
325330
):
326331
"""
327332
Dump the code into the local path and run the code.
@@ -330,7 +335,7 @@ def dump_python_code_run_and_get_results(
330335
with open(os.path.join(local_path, random_file_name), "w") as f:
331336
f.write(code)
332337
entry = f"python {random_file_name}"
333-
log_output = self.run(entry, local_path, env)
338+
log_output = self.run(entry, local_path, env, running_extra_volume=running_extra_volume)
334339
results = []
335340
os.remove(os.path.join(local_path, random_file_name))
336341
for name in dump_file_names:

0 commit comments

Comments
 (0)