We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8de932e commit bdd1461Copy full SHA for bdd1461
codeflash/optimization/function_optimizer.py
@@ -719,8 +719,10 @@ def determine_best_candidate(
719
# TODO: better way to resolve conflicts with same min ranking
720
overall_ranking = {key: diff_lens_ranking[key] + runtimes_ranking[key] for key in diff_lens_ranking}
721
min_key = min(overall_ranking, key=overall_ranking.get)
722
- else:
+ elif len(optimization_ids) == 1:
723
min_key = 0 # only one candidate in valid _opts, already returns if there are no valid candidates
724
+ else: # 0? shouldn't happen but it's there to escape potential bugs
725
+ return None
726
best_optimization = valid_candidates_with_shorter_code[min_key]
727
# reassign code string which is the shortest
728
ai_service_client.log_results(
0 commit comments