INNER CODE UNIT · Python
step
OSU-NLP-Group/ScienceAgentBench · agent.py:151
def step(self, out_fname, output_fname):
out_module_name = out_fname.replace("/", '.')[:-3] # remove ".py" suffix
special_err, err_msg = self.install(out_fname)
if not special_err:
try:
exec_res = subprocess.run(["conda", "run", "-n", "sci-agent-eval", "python", "-m", out_module_name], capture_output=True, timeout=900)
except subprocess.TimeoutExpired:
special_err = True
err_msg = "The program fails to finish execution within 900 seconds. Please try to reduce the execution time of your implementation."
if (not special_err) and exec_res.returncode == 0:
if not Path(output_fname).exists():
special_err = True
err_msg = "The program does not save its output correctly. Please check if the functions are executed and the output path is correct."
if (not special_err) and exec_res.returncode == 0: