Skip to content

Commit dbc7f92

Browse files
committed
activate more mutation prompts
1 parent 74f7146 commit dbc7f92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llamea/llamea.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@ def construct_prompt(self, individual, power_law_mutation=False):
273273
new_mutation_prompt = f"""
274274
Refine the strategy of the selected solution to improve it. Make sure you only change {(prob*100):.1f}% of the code, which means if the code has 100 lines, you can only change {prob*100} lines, and the rest of the lines should remain unchanged. This input code has {num_lines} lines, so you can only change {max(1, int(prob*num_lines))} lines, the rest {num_lines-max(1, int(prob*num_lines))} lines should remain unchanged. This changing rate {(prob*100):.1f}% is the mandatory requirement, you cannot change more or less than this rate.
275275
"""
276-
self.mutation_prompts = [new_mutation_prompt]
276+
# self.mutation_prompts = [new_mutation_prompt]
277277

278-
mutation_operator = random.choice(self.mutation_prompts)
278+
mutation_operator = random.choice(self.mutation_prompts + [new_mutation_prompt])
279279
individual.set_operator(mutation_operator)
280280

281281
final_prompt = f"""{self.task_prompt}

0 commit comments

Comments
 (0)