(
self,
init_file: str = "initial_content_stub.txt",
evaluator_file: str = "evaluator_stub.py",
config_file: str = "config.yml",
iterations: int = 5,
extra_param: List[str] = [],
**kwargs,
)
| 27 | @register_model("openevolve") |
| 28 | class OpenEvolve(LM): |
| 29 | def __init__( |
| 30 | self, |
| 31 | init_file: str = "initial_content_stub.txt", |
| 32 | evaluator_file: str = "evaluator_stub.py", |
| 33 | config_file: str = "config.yml", |
| 34 | iterations: int = 5, |
| 35 | extra_param: List[str] = [], |
| 36 | **kwargs, |
| 37 | ): |
| 38 | super().__init__() |
| 39 | self.init_file = init_file |
| 40 | self.evaluator_file = evaluator_file |
| 41 | self.iterations = iterations |
| 42 | self.extra_param = extra_param |
| 43 | self.config_file = config_file |
| 44 | |
| 45 | # folder must match prompt:template_dir in config.yml! |
| 46 | self.prompt_path = "examples/lm_eval/prompts/system_message.txt" |
| 47 | self.evaluator_prompt_path = "examples/lm_eval/prompts/evaluator_system_message.txt" |
| 48 | self.best_path = "examples/lm_eval/openevolve_output/best/best_program.txt" |
| 49 | self.base_system_message = "You are an expert task solver, with a lot of commonsense, math, language and coding knowledge.\n\nConsider this task:\n```{prompt}´´´" |
| 50 | |
| 51 | def generate(self, prompts: List[str], max_gen_toks: int = None, stop=None, **kwargs): |
| 52 | outs = [] |
nothing calls this directly
no outgoing calls
no test coverage detected