mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-29 00:17:44 +00:00
refactor: add run_ret_code method and update run method to use it (#623)
* refactor: Add run_ret_code method and update run method to use it * feat: Add kwargs support to run methods and test for run_ret_code * fix: preserve exit code after chmod in DockerEnv entry command * chore: Change file permissions from 755 to 644 in env_tpl directory * refactor: Return execution code and update evaluator logic * lint * refactor: Use MappingProxyType for running_extra_volume in DockerEnv methods * lint
This commit is contained in:
@@ -63,7 +63,9 @@ class EnsembleCoSTEEREvaluator(CoSTEEREvaluator):
|
||||
)
|
||||
|
||||
implementation.inject_files(**{fname: test_code})
|
||||
stdout = implementation.execute(env=de, entry=f"python {fname}")
|
||||
stdout, ret_code = implementation.execute_ret_code(env=de, entry=f"python {fname}")
|
||||
|
||||
stdout += f"\nNOTE: the above scripts run with return code {ret_code}"
|
||||
|
||||
if "main.py" in implementation.file_dict:
|
||||
workflow_stdout = implementation.execute(env=de, entry="python main.py")
|
||||
@@ -81,6 +83,6 @@ class EnsembleCoSTEEREvaluator(CoSTEEREvaluator):
|
||||
stdout=stdout,
|
||||
workflow_stdout=workflow_stdout,
|
||||
)
|
||||
return build_cls_from_json_with_retry(
|
||||
EnsembleEvalFeedback, system_prompt=system_prompt, user_prompt=user_prompt
|
||||
)
|
||||
efb = build_cls_from_json_with_retry(EnsembleEvalFeedback, system_prompt=system_prompt, user_prompt=user_prompt)
|
||||
efb.final_decision = efb.final_decision and ret_code == 0
|
||||
return efb
|
||||
|
||||
Reference in New Issue
Block a user