Skip to content

Commit c082b15

Browse files
committed
Set combined_score = -inf for failed evaluations
Failed evaluation should never have better score than successful one.
1 parent 4009cc1 commit c082b15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openevolve/evaluator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ async def evaluate_program(
260260
"error_type": "timeout",
261261
}
262262

263-
return {"error": 0.0, "timeout": True}
263+
return {"combined_score": float('-inf'), "error": 0.0, "timeout": True}
264264

265265
except Exception as e:
266266
last_exception = e
@@ -291,7 +291,7 @@ async def evaluate_program(
291291
logger.error(
292292
f"All evaluation attempts failed for program{program_id_str}. Last error: {str(last_exception)}"
293293
)
294-
return {"error": 0.0}
294+
return {"combined_score": float('-inf'), "error": 0.0}
295295

296296
def _process_evaluation_result(self, result: Any) -> EvaluationResult:
297297
"""

0 commit comments

Comments
 (0)