File tree Expand file tree Collapse file tree
components/coder/model_coder Expand file tree Collapse file tree Original file line number Diff line number Diff 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 } " )
Original file line number Diff line number Diff 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 } "
You can’t perform that action at this time.
0 commit comments