Skip to content

Commit 1f910a5

Browse files
authored
fix: Use fixed file name in model costeer & fixing cache (#311)
* use fixed name in model costeer to enable cache * fix ci
1 parent 5fb0608 commit 1f910a5

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

rdagent/components/coder/model_coder/model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def execute(
115115
dump_file_names=["execution_feedback_str.pkl", "execution_model_output.pkl"],
116116
local_path=str(self.workspace_path),
117117
env={},
118+
code_dump_file_py_name="model_test",
118119
)
119120
if results is None:
120121
raise RuntimeError(f"Error in running the model code: {log}")

rdagent/utils/env.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,12 @@ def dump_python_code_run_and_get_results(
327327
local_path: str | None = None,
328328
env: dict | None = None,
329329
running_extra_volume: dict | None = None,
330+
code_dump_file_py_name: Optional[str] = None,
330331
):
331332
"""
332333
Dump the code into the local path and run the code.
333334
"""
334-
random_file_name = f"{uuid.uuid4()}.py"
335+
random_file_name = f"{uuid.uuid4()}.py" if code_dump_file_py_name is None else f"{code_dump_file_py_name}.py"
335336
with open(os.path.join(local_path, random_file_name), "w") as f:
336337
f.write(code)
337338
entry = f"python {random_file_name}"

0 commit comments

Comments
 (0)