Skip to content

Commit efa27f3

Browse files
committed
allow capo to overwrite eval strategy
1 parent 5666134 commit efa27f3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

promptolution/optimizers/capo.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ def __init__(
106106
f" Setting max_n_blocks_eval to {self.task.n_blocks}."
107107
)
108108
self.max_n_blocks_eval = self.task.n_blocks
109+
if "block" not in self.task.eval_strategy:
110+
logger.warning(
111+
f"ℹ️ CAPO requires 'block' in the eval_strategy, but got {self.task.eval_strategy}. Setting eval_strategy to 'sequential_block'."
112+
)
113+
self.task.eval_strategy = "sequential_block"
109114
self.population_size = len(self.prompts)
110115

111116
if hasattr(self.predictor, "begin_marker") and hasattr(self.predictor, "end_marker"):

0 commit comments

Comments
 (0)