Skip to content

Commit

Permalink
add subset to old format
Browse files Browse the repository at this point in the history
  • Loading branch information
Samoed committed Sep 16, 2024
1 parent 7e0fe6f commit 98ede15
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions results.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def _generate_examples(self, filepath):
# Old MTEB format
if isinstance(res_dict.get(split), dict):
for k, v in res_dict.get(split, {}).items():
if key in ["hf_subset", "languages"]:
if k in ["hf_subset", "languages"]:
res_dict[k] = v

v /= len(TEST_AVG_SPLIT[ds_name])
Expand All @@ -383,7 +383,7 @@ def _generate_examples(self, filepath):
elif isinstance(res_dict.get(split), list):
assert len(res_dict[split]) == 1, "Only single-lists supported for now"
for k, v in res_dict[split][0].items():
if key in ["hf_subset", "languages"]:
if k in ["hf_subset", "languages"]:
res_dict[k] = v
if not isinstance(v, float): continue
v /= len(TEST_AVG_SPLIT[ds_name])
Expand Down Expand Up @@ -451,6 +451,8 @@ def _generate_examples(self, filepath):
if lang in SKIP_KEYS: continue
test_result_lang = res_dict.get(lang) if is_multilingual else res_dict
subset = test_result_lang.pop("hf_subset", "")
if subset == "" and is_multilingual:
subset = lang
for metric, score in test_result_lang.items():
if not isinstance(score, dict):
score = {metric: score}
Expand Down

0 comments on commit 98ede15

Please sign in to comment.