Skip to content

Commit

Permalink
CR
Browse files Browse the repository at this point in the history
  • Loading branch information
bovard committed Jun 26, 2024
1 parent a232bd1 commit dc0c8af
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kaggle_environments/envs/llm_20_questions/llm_20_questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@
RANDOM_ANSWERER = "random_answerer"

def weighted_random_category(keywords_list):
try:
return random.choice(keywords_list, weights=[len(entry["words"]) for entry in keywords_list], k=1)[0]
try:
return random.choices(population=keywords_list, weights=[len(entry["words"]) for entry in keywords_list], k=1)[0]
except:
print("FAIL")
pass
return random.choice(keywords_list)

Expand Down

0 comments on commit dc0c8af

Please sign in to comment.