Skip to content

Commit

Permalink
[m_mmul] added multilingual evaluation from alexandrainst/m_mmlu (Ele…
Browse files Browse the repository at this point in the history
  • Loading branch information
giux78 authored Feb 12, 2024
1 parent 7397b96 commit b69c67c
Show file tree
Hide file tree
Showing 34 changed files with 178 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/_default_yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
group:
- m_mmlu
dataset_path: alexandrainst/m_mmlu
test_split: test
fewshot_split: train
fewshot_config:
sampler: first_n
output_type: multiple_choice
doc_to_text: "{{instruction.strip()}}\nA. {{option_a}}\nB. {{option_b}}\nC. {{option_c}}\nD. {{option_d}}\nAnswer:"
doc_to_choice: ["A", "B", "C", "D"]
doc_to_target: answer
metric_list:
- metric: acc
aggregation: mean
higher_is_better: true
metadata:
version: 0.0
33 changes: 33 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/_generate_configs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import yaml
import datasets

from tqdm import tqdm


def main() -> None:
dataset_path = "alexandrainst/m_mmlu"

# Removed hy and sk subdataset because the original dataset is broken
# I created this PR https://huggingface.co/datasets/alexandrainst/m_mmlu/discussions/3
# on the dataset for the authors, in case it will be accepeted the filter can be removed
keys_without_hy_sk = list(filter(lambda k: ('hy' not in k and 'sk' not in k),
datasets.get_dataset_infos(dataset_path).keys()))

for task in tqdm():
file_name = f"m_mmlu_{task}.yaml"
try:
with open(f"{file_name}", "w") as f:
f.write("# Generated by _generate_configs.py\n")
yaml.dump(
{
"include": "_default_yaml",
"task": f"{dataset_path.split('/')[-1]}_{task}",
"dataset_name": task,
},
f,
)
except FileExistsError:
pass

if __name__ == "__main__":
main()
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_ar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: ar
include: _default_yaml
task: m_mmlu_ar
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_bn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: bn
include: _default_yaml
task: m_mmlu_bn
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_ca.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: ca
include: _default_yaml
task: m_mmlu_ca
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_da.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: da
include: _default_yaml
task: m_mmlu_da
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_de.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: de
include: _default_yaml
task: m_mmlu_de
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_en.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: en
include: _default_yaml
task: m_mmlu_en
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_es.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: es
include: _default_yaml
task: m_mmlu_es
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_eu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: eu
include: _default_yaml
task: m_mmlu_eu
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_fr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: fr
include: _default_yaml
task: m_mmlu_fr
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_gu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: gu
include: _default_yaml
task: m_mmlu_gu
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_hi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: hi
include: _default_yaml
task: m_mmlu_hi
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_hr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: hr
include: _default_yaml
task: m_mmlu_hr
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_hu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: hu
include: _default_yaml
task: m_mmlu_hu
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_id.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: id
include: _default_yaml
task: m_mmlu_id
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_is.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: is
include: _default_yaml
task: m_mmlu_is
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_it.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: it
include: _default_yaml
task: m_mmlu_it
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_kn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: kn
include: _default_yaml
task: m_mmlu_kn
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_ml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: ml
include: _default_yaml
task: m_mmlu_ml
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_mr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: mr
include: _default_yaml
task: m_mmlu_mr
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_nb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: nb
include: _default_yaml
task: m_mmlu_nb
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_ne.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: ne
include: _default_yaml
task: m_mmlu_ne
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_nl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: nl
include: _default_yaml
task: m_mmlu_nl
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_pt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: pt
include: _default_yaml
task: m_mmlu_pt
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_ro.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: ro
include: _default_yaml
task: m_mmlu_ro
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_ru.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: ru
include: _default_yaml
task: m_mmlu_ru
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_sr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: sr
include: _default_yaml
task: m_mmlu_sr
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_sv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: sv
include: _default_yaml
task: m_mmlu_sv
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_ta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: ta
include: _default_yaml
task: m_mmlu_ta
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_te.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: te
include: _default_yaml
task: m_mmlu_te
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_uk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: uk
include: _default_yaml
task: m_mmlu_uk
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_vi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: vi
include: _default_yaml
task: m_mmlu_vi
4 changes: 4 additions & 0 deletions lm_eval/tasks/okapi/mmlu_multilingual/m_mmlu_zh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by _generate_configs.py
dataset_name: zh
include: _default_yaml
task: m_mmlu_zh

0 comments on commit b69c67c

Please sign in to comment.