Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions openevolve/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def run_evolution(
iterations: Optional[int] = None,
output_dir: Optional[str] = None,
cleanup: bool = True,
target_score: Optional[float] = None,
checkpoint_path: Optional[str] = None,
) -> EvolutionResult:
"""
Run evolution with flexible inputs - the main library API
Expand Down Expand Up @@ -90,7 +92,7 @@ def my_evaluator(program_path):
)
"""
return asyncio.run(
_run_evolution_async(initial_program, evaluator, config, iterations, output_dir, cleanup)
_run_evolution_async(initial_program, evaluator, config, iterations, output_dir, cleanup, target_score, checkpoint_path)
)


Expand All @@ -101,6 +103,8 @@ async def _run_evolution_async(
iterations: Optional[int],
output_dir: Optional[str],
cleanup: bool,
target_score: Optional[float] = None,
checkpoint_path: Optional[str] = None,
) -> EvolutionResult:
"""Async implementation of run_evolution"""

Expand Down Expand Up @@ -156,7 +160,7 @@ async def _run_evolution_async(
output_dir=actual_output_dir,
)

best_program = await controller.run(iterations=iterations)
best_program = await controller.run(iterations=iterations,target_score=target_score,checkpoint_path=checkpoint_path)

# Prepare result
best_score = 0.0
Expand Down
1 change: 0 additions & 1 deletion openevolve/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ async def run(
Best program found
"""
max_iterations = iterations or self.config.max_iterations

# Determine starting iteration
start_iteration = 0
if checkpoint_path and os.path.exists(checkpoint_path):
Expand Down
Loading