Skip to content

Commit 175182e

Browse files
committed
Update api.py
1 parent d0fd321 commit 175182e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

openevolve/api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ async def _run_evolution_async(
141141
# Process evaluator
142142
evaluator_path = _prepare_evaluator(evaluator, temp_dir, temp_files)
143143

144+
# Auto-disable cascade evaluation if the evaluator doesn't define stage functions
145+
if config_obj.evaluator.cascade_evaluation:
146+
with open(evaluator_path, "r") as f:
147+
eval_content = f.read()
148+
if "evaluate_stage1" not in eval_content:
149+
config_obj.evaluator.cascade_evaluation = False
150+
144151
# Create and run controller
145152
controller = OpenEvolve(
146153
initial_program_path=program_path,

0 commit comments

Comments
 (0)