Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix a bug in KGFBWorkspace (about data loading) #495

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix train.py to main.py for refactored kaggle template
  • Loading branch information
XianBW committed Nov 25, 2024
commit 2d588b7b20202be399cfad4f98db22b7226d89e9
8 changes: 6 additions & 2 deletions rdagent/components/coder/factor_coder/factor.py
Original file line number Diff line number Diff line change
@@ -148,9 +148,13 @@ def execute(self, data_type: str = "Debug") -> Tuple[str, pd.DataFrame]:
elif self.target_task.version == 2:
execution_code_path = self.workspace_path / f"{uuid.uuid4()}.py"
if KAGGLE_IMPLEMENT_SETTING.template_path == "rdagent/scenarios/kaggle/tpl_ex":
execution_code_path.write_text((Path(__file__).parent / "factor_execution_template_v2.txt").read_text())
execution_code_path.write_text(
(Path(__file__).parent / "factor_execution_template_v2.txt").read_text()
)
else:
execution_code_path.write_text((Path(__file__).parent / "factor_execution_template_v1.txt").read_text())
execution_code_path.write_text(
(Path(__file__).parent / "factor_execution_template_v1.txt").read_text()
)

try:
subprocess.check_output(
7 changes: 6 additions & 1 deletion rdagent/scenarios/kaggle/experiment/scenario.py
Original file line number Diff line number Diff line change
@@ -125,7 +125,12 @@ def background(self) -> str:
background_template = prompt_dict["kg_background"]

train_script = (
Path(__file__).parent / f"{KAGGLE_IMPLEMENT_SETTING.competition}_template" / "train.py"
Path(__file__).resolve()
/ Path(KAGGLE_IMPLEMENT_SETTING.template_path).resolve()
/ KAGGLE_IMPLEMENT_SETTING.competition
/ "train.py"
if KAGGLE_IMPLEMENT_SETTING.template_path != "rdagent/scenarios/kaggle/tpl_ex"
else "main.py"
).read_text()

background_prompt = (
12 changes: 10 additions & 2 deletions rdagent/scenarios/kaggle/experiment/workspace.py
Original file line number Diff line number Diff line change
@@ -70,7 +70,11 @@ def generate_preprocess_data(
"others.pkl",
],
running_extra_volume=(
{KAGGLE_IMPLEMENT_SETTING.local_data_path + "/" + KAGGLE_IMPLEMENT_SETTING.competition: "/kaggle/input"}
{
KAGGLE_IMPLEMENT_SETTING.local_data_path
+ "/"
+ KAGGLE_IMPLEMENT_SETTING.competition: "/kaggle/input"
}
if KAGGLE_IMPLEMENT_SETTING.competition
else None
),
@@ -92,7 +96,11 @@ def generate_preprocess_data(
"others.pkl",
],
running_extra_volume=(
{KAGGLE_IMPLEMENT_SETTING.local_data_path + "/" + KAGGLE_IMPLEMENT_SETTING.competition: "/kaggle/input"}
{
KAGGLE_IMPLEMENT_SETTING.local_data_path
+ "/"
+ KAGGLE_IMPLEMENT_SETTING.competition: "/kaggle/input"
}
if KAGGLE_IMPLEMENT_SETTING.competition
else None
),