Skip to content
Snippets Groups Projects
Commit fb5630bc authored by Max Kimmich's avatar Max Kimmich
Browse files

Fix evolutions of current iteration not being accumulated

parent 4ecbf231
No related branches found
No related tags found
No related merge requests found
......@@ -250,9 +250,11 @@ def run_episode(evo_alg_str: str):
if evo_alg_str == "de":
# DE needs best prompt for evolution
best_prompt_current_evolution = max(range(N), key=lambda i: S[t - 1][i])
# keep track of evolutions of current iteration
new_evolutions = []
new_evolutions_scores = []
for i in trange(N, desc="N", leave=False):
new_evolutions = []
new_evolutions_scores = []
# for both GA and DE we start with two parent prompts
pr1, pr2 = selection(P[t - 1], S[t - 1])
......@@ -302,7 +304,6 @@ def run_episode(evo_alg_str: str):
# p∗ ← argmaxp∈PT f(p, D)
p = max(range(N), key=lambda i: S[T][i])
logger.info(f"Best prompt: {P[T][p]}")
print(P[p])
# We pick the prompt with the highest score on the development set and report its score on the testset.
test_D = load_dataset("SetFit/sst2", split="test")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment