Skip to content

Commit

Permalink
do not randomize number of demos
Browse files Browse the repository at this point in the history
  • Loading branch information
jpt-sn committed Dec 27, 2024
1 parent 1436f5f commit 440d684
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions examples/optimize/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ def add_demos(agent: Agent, tapes: list[Tape], max_n_demos: int, seed: int = 1)
rng = random.Random(seed)
agent_copy = agent.model_copy(deep=True)
for template_name, template in agent_copy.templates.items():
k_max = min(max_n_demos, len(demos[template_name]))
# k = rng.randint(0, k_max) # random number of demos
k = k_max
k = min(max_n_demos, len(demos[template_name]))
template.demos = rng.sample(demos[template_name], k) # random selection of demos
return agent_copy

Expand Down

0 comments on commit 440d684

Please sign in to comment.