diff --git a/evoprompt/evolution/evolution.py b/evoprompt/evolution/evolution.py index fe983ab98546b615803ebe876bbf6f55ed6e1195..b4cef158f212d1ab78c8f81af169d02b60568891 100644 --- a/evoprompt/evolution/evolution.py +++ b/evoprompt/evolution/evolution.py @@ -199,18 +199,17 @@ class EvolutionAlgorithm(PromptOptimization, metaclass=ABCMeta): template_demo.extend(demo_messages) messages_demos = [] - if self.evolution_demo_source is not None: - if "static" in self.evolution_demo_source: - messages_demos += self.condense_messages(template_demo) - if "interactive" in self.evolution_demo_source: - messages_demos += self.evolution_model.build_demonstration_data( - [ - (annotated_sample.input, annotated_sample.label) - for annotated_sample in self.annotation_handler.get_annotations( - evolution_step=idx - ) - ] - ) + if "static" in self.evolution_demo_source: + messages_demos += self.condense_messages(template_demo) + if "interactive" in self.evolution_demo_source: + messages_demos += self.evolution_model.build_demonstration_data( + [ + (annotated_sample.input, annotated_sample.label) + for annotated_sample in self.annotation_handler.get_annotations( + evolution_step=idx + ) + ] + ) filled_prompt = prompt.format(**prompt_format_kwargs) evolutions_steps.append(