mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-27 23:47:46 +00:00
fix: fix a minor bug in DS eval (#1012)
This commit is contained in:
@@ -65,7 +65,7 @@ class EnsembleCoSTEEREvaluator(CoSTEEREvaluator):
|
||||
implementation.inject_files(**{fname: test_code})
|
||||
result = implementation.run(env=env, entry=f"python {fname}")
|
||||
stdout = result.stdout
|
||||
ret_code = result.ret_code
|
||||
ret_code = result.exit_code
|
||||
|
||||
stdout += f"\nNOTE: the above scripts run with return code {ret_code}"
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class FeatureCoSTEEREvaluator(CoSTEEREvaluator):
|
||||
|
||||
result = implementation.run(env=env, entry=f"python {fname}")
|
||||
|
||||
if "main.py" in implementation.file_dict and result.ret_code == 0:
|
||||
if "main.py" in implementation.file_dict and result.exit_code == 0:
|
||||
workflow_stdout = implementation.execute(env=env, entry="python main.py")
|
||||
workflow_stdout = remove_eda_part(workflow_stdout)
|
||||
else:
|
||||
@@ -76,6 +76,6 @@ class FeatureCoSTEEREvaluator(CoSTEEREvaluator):
|
||||
user_prompt=user_prompt,
|
||||
init_kwargs_update_func=FeatureEvalFeedback.val_and_update_init_dict,
|
||||
)
|
||||
fb.final_decision = fb.final_decision and result.ret_code == 0
|
||||
fb.final_decision = fb.final_decision and result.exit_code == 0
|
||||
|
||||
return fb
|
||||
|
||||
@@ -69,7 +69,7 @@ class ModelGeneralCaseSpecEvaluator(CoSTEEREvaluator):
|
||||
implementation.inject_files(**{fname: test_code})
|
||||
result = implementation.run(env=env, entry=f"python {fname}")
|
||||
stdout = result.stdout
|
||||
ret_code = result.ret_code
|
||||
ret_code = result.exit_code
|
||||
|
||||
if stdout is None:
|
||||
raise CoderError(
|
||||
@@ -115,6 +115,6 @@ class ModelGeneralCaseSpecEvaluator(CoSTEEREvaluator):
|
||||
user_prompt=user_prompt,
|
||||
init_kwargs_update_func=ModelSingleFeedback.val_and_update_init_dict,
|
||||
)
|
||||
fb.final_decision = fb.final_decision and result.ret_code == 0
|
||||
fb.final_decision = fb.final_decision and result.exit_code == 0
|
||||
|
||||
return fb
|
||||
|
||||
@@ -59,7 +59,7 @@ class PipelineCoSTEEREvaluator(CoSTEEREvaluator):
|
||||
implementation.execute(env=env, entry=get_clear_ws_cmd())
|
||||
result = implementation.run(env=env, entry=f"python -m coverage run main.py")
|
||||
implementation.running_info.running_time = result.running_time
|
||||
execute_ret_code = result.ret_code
|
||||
execute_ret_code = result.exit_code
|
||||
stdout = remove_eda_part(result.stdout)
|
||||
stdout += f"The code executed {'successfully' if execute_ret_code == 0 else 'failed'}."
|
||||
|
||||
@@ -109,7 +109,7 @@ class PipelineCoSTEEREvaluator(CoSTEEREvaluator):
|
||||
# stdout += "----Submission Check 1-----\n"
|
||||
submission_result = implementation.run(env=env, entry="python test/submission_format_test.py")
|
||||
submission_check_out = submission_result.stdout
|
||||
submission_ret_code = submission_result.ret_code
|
||||
submission_ret_code = submission_result.exit_code
|
||||
if DS_RD_SETTING.rule_base_eval:
|
||||
if execute_ret_code == 0 and score_ret_code == 0 and submission_ret_code == 0:
|
||||
return PipelineSingleFeedback(
|
||||
|
||||
@@ -54,7 +54,7 @@ class DataLoaderCoSTEEREvaluator(CoSTEEREvaluator):
|
||||
implementation.inject_files(**{fname: test_code})
|
||||
result = implementation.run(env=env, entry=f"python {fname}")
|
||||
stdout = result.stdout
|
||||
ret_code = result.ret_code
|
||||
ret_code = result.exit_code
|
||||
match = re.search(r"(.*?)=== Start of EDA part ===(.*)=== End of EDA part ===(.*)", stdout, re.DOTALL)
|
||||
stdout_part_1, eda_output, stdout_part_2 = match.groups() if match else (stdout, None, "")
|
||||
stdout = stdout_part_1 + stdout_part_2
|
||||
|
||||
@@ -123,7 +123,7 @@ class WorkflowGeneralCaseSpecEvaluator(CoSTEEREvaluator):
|
||||
# stdout += "----Submission Check 1-----\n"
|
||||
submission_result = implementation.run(env=env, entry="python test/submission_format_test.py")
|
||||
submission_check_out = submission_result.stdout
|
||||
submission_ret_code = submission_result.ret_code
|
||||
submission_ret_code = submission_result.exit_code
|
||||
stdout += "\n" + submission_check_out
|
||||
|
||||
system_prompt = T(".prompts:workflow_eval.system").r(
|
||||
|
||||
@@ -55,7 +55,7 @@ class DSCoSTEERCoSTEEREvaluator(CoSTEEREvaluator):
|
||||
# execute workflow
|
||||
result = implementation.run(env=env, entry="python -m coverage run main.py")
|
||||
stdout = result.stdout
|
||||
execute_ret_code = result.ret_code
|
||||
execute_ret_code = result.exit_code
|
||||
implementation.running_info.running_time = result.running_time
|
||||
|
||||
match = re.search(r"(.*?)=== Start of EDA part ===(.*)=== End of EDA part ===", stdout, re.DOTALL)
|
||||
|
||||
@@ -82,7 +82,7 @@ class TestEval(TestEvalBase):
|
||||
**{file: workspace.DEL_KEY for file in ["submission_format_valid.py", "submission_test.csv"]}
|
||||
)
|
||||
workspace.inject_files(**{"test/mle_submission_format_test.output": submission_result.stdout})
|
||||
return submission_result.stdout, submission_result.ret_code
|
||||
return submission_result.stdout, submission_result.exit_code
|
||||
|
||||
def enabled(self, competition) -> bool:
|
||||
return Path(
|
||||
@@ -119,7 +119,7 @@ class MLETestEval(TestEvalBase):
|
||||
submission_result = workspace.run(env=self.env, entry="python test/mle_submission_format_test.py")
|
||||
|
||||
workspace.inject_files(**{"test/mle_submission_format_test.output": submission_result.stdout})
|
||||
return submission_result.stdout, submission_result.ret_code
|
||||
return submission_result.stdout, submission_result.exit_code
|
||||
|
||||
def enabled(self, competition) -> bool:
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user