Skip to content

Commit

Permalink
fix duplicate error in paritioner
Browse files Browse the repository at this point in the history
  • Loading branch information
bittersweet1999 committed Sep 23, 2024
1 parent 73b7458 commit e4a4066
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions opencompass/partitioners/sub_naive.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def remove_duplicate_pairs(model_combinations):
combo_dict = {}
for i, combo in enumerate(model_combinations):
sorted_names = tuple(sorted((combo[0]['abbr'], combo[1]['abbr'])))
if sorted_names[0] == sorted_names[1]:
continue
if sorted_names not in combo_dict:
combo_dict[sorted_names] = i
new_model_combinations = [
Expand Down Expand Up @@ -115,6 +117,8 @@ def get_model_combinations(
model_combinations = list(product(base_models, compare_models))
unique_combinations = remove_duplicate_pairs(
[combo for combo in model_combinations if combo[0] != combo[1]])
print(unique_combinations)
exit()
return unique_combinations
elif mode == 'fixed':
pass
Expand Down

0 comments on commit e4a4066

Please sign in to comment.