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: Use fixed file name in model costeer & fixing cache #311

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions rdagent/components/coder/model_coder/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def execute(
dump_file_names=["execution_feedback_str.pkl", "execution_model_output.pkl"],
local_path=str(self.workspace_path),
env={},
code_dump_file_py_name="model_test",
)
if results is None:
raise RuntimeError(f"Error in running the model code: {log}")
Expand Down
3 changes: 2 additions & 1 deletion rdagent/utils/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,12 @@ def dump_python_code_run_and_get_results(
local_path: str | None = None,
env: dict | None = None,
running_extra_volume: dict | None = None,
code_dump_file_py_name: Optional[str] = None,
):
"""
Dump the code into the local path and run the code.
"""
random_file_name = f"{uuid.uuid4()}.py"
random_file_name = f"{uuid.uuid4()}.py" if code_dump_file_py_name is None else f"{code_dump_file_py_name}.py"
with open(os.path.join(local_path, random_file_name), "w") as f:
f.write(code)
entry = f"python {random_file_name}"
Expand Down
Loading