chen459664 commited on
Commit
3cfb536
·
verified ·
1 Parent(s): ad89f04

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval.egg-info/dependency_links.txt +1 -0
  2. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/med_concepts_qa/med_concepts_qa_icd10proc_easy.yaml +5 -0
  3. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/medqa/preprocess_medqa.py +13 -0
  4. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mela/mela_ar.yaml +4 -0
  5. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mela/mela_en.yaml +17 -0
  6. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mela/mela_is.yaml +4 -0
  7. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mela/mela_ru.yaml +3 -0
  8. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/README.md +84 -0
  9. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_arc_permute.yaml +5 -0
  10. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_arc_secondary_permute.yaml +5 -0
  11. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_hellaswag_secondary.yaml +5 -0
  12. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_hellaswag_secondary_permute.yaml +5 -0
  13. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_mmlu.yaml +20 -0
  14. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_mmlu_permute.yaml +5 -0
  15. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_mmlu_secondary_permute.yaml +5 -0
  16. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_permute.yaml +13 -0
  17. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_secondary.yaml +14 -0
  18. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_secondary_permute.yaml +13 -0
  19. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_truthfulqa.yaml +35 -0
  20. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_truthfulqa_permute.yaml +6 -0
  21. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_truthfulqa_secondary_permute.yaml +5 -0
  22. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_winogrande.yaml +20 -0
  23. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_winogrande_secondary_permute.yaml +5 -0
  24. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/process_docs.py +186 -0
  25. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/process_docs_permute.py +226 -0
  26. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/README.md +94 -0
  27. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/direct_yaml +35 -0
  28. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_bn.yaml +12 -0
  29. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_de.yaml +12 -0
  30. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_en.yaml +12 -0
  31. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_es.yaml +12 -0
  32. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_fr.yaml +12 -0
  33. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_ja.yaml +12 -0
  34. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_ru.yaml +12 -0
  35. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_sw.yaml +12 -0
  36. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_te.yaml +12 -0
  37. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_th.yaml +12 -0
  38. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_zh.yaml +12 -0
  39. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/cot_yaml +36 -0
  40. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_bn.yaml +12 -0
  41. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_de.yaml +12 -0
  42. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_en.yaml +12 -0
  43. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_es.yaml +12 -0
  44. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_fr.yaml +12 -0
  45. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_ja.yaml +12 -0
  46. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_ru.yaml +12 -0
  47. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_sw.yaml +12 -0
  48. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_te.yaml +12 -0
  49. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_th.yaml +12 -0
  50. lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_zh.yaml +12 -0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval.egg-info/dependency_links.txt ADDED
@@ -0,0 +1 @@
 
 
1
+
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/med_concepts_qa/med_concepts_qa_icd10proc_easy.yaml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ dataset_name: icd10proc_easy
2
+ include: _default_template_yaml
3
+ tag: med_concepts_qa_icd10proc_tasks
4
+ task: med_concepts_qa_icd10proc_easy
5
+ task_alias: icd10proc_easy
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/medqa/preprocess_medqa.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def doc_to_text(doc) -> str:
2
+ option_choices = {
3
+ "A": doc["ending0"],
4
+ "B": doc["ending1"],
5
+ "C": doc["ending2"],
6
+ "D": doc["ending3"],
7
+ }
8
+ answers = "".join((f"{k}. {v}\n") for k, v in option_choices.items())
9
+ return f"Question: {doc['sent1']}\n{answers}Answer:"
10
+
11
+
12
+ def doc_to_target(doc) -> int:
13
+ return doc["label"]
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mela/mela_ar.yaml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ include: mela_en.yaml
2
+ task: mela_ar
3
+ dataset_name: ar
4
+ training_split: null
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mela/mela_en.yaml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ task: mela_en
2
+ dataset_path: Geralt-Targaryen/MELA
3
+ dataset_name: en
4
+ training_split: train
5
+ validation_split: dev
6
+ test_split: test
7
+ output_type: multiple_choice
8
+ doc_to_text: "Sentence: {{sentence}}\nDetermine whether this sentence is acceptable or unacceptable?\nA. Acceptable\nB. Unacceptable\nAnswer:"
9
+ doc_to_choice: ["A", "B"]
10
+ doc_to_target: "{{['B', 'A'][label]}}"
11
+ description: "Determine whether the following sentence(s) violate certain linguistic constraints. If yes, then it is \"unacceptable\"; otherwise, \"acceptable\".\n\n"
12
+ fewshot_split: dev
13
+ fewshot_config:
14
+ sampler: first_n
15
+ metric_list:
16
+ - metric: mcc
17
+ higher_is_better: true
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mela/mela_is.yaml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ include: mela_en.yaml
2
+ task: mela_is
3
+ dataset_name: is
4
+ training_split: null
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mela/mela_ru.yaml ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ include: mela_en.yaml
2
+ task: mela_ru
3
+ dataset_name: ru
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/README.md ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Metabench
2
+
3
+ ### Paper
4
+
5
+ Title: `metabench` -- A Sparse Benchmark to Measure General Ability in Large Language Models
6
+
7
+ Abstract: https://arxiv.org/abs/2407.12844
8
+
9
+ Large Language Models (LLMs) vary in their abilities on a range of tasks. Initiatives such as the 𝙾𝚙𝚎𝚗 𝙻𝙻𝙼 𝙻𝚎𝚊𝚍𝚎𝚛𝚋𝚘𝚊𝚛𝚍 aim to quantify these differences with several large benchmarks (sets of test items to which an LLM can respond either correctly or incorrectly). However, high correlations within and between benchmark scores suggest that (1) there exists a small set of common underlying abilities that these benchmarks measure, and (2) items tap into redundant information and the benchmarks may thus be considerably compressed. We use data from $n> 5000$ LLMs to identify the most informative items of six benchmarks, ARC, GSM8K, HellaSwag, MMLU, TruthfulQA and WinoGrande (with d=28,632 items in total). From them we distill a sparse benchmark, `metabench`, that has less than $3%$ of the original size of all six benchmarks combined. This new sparse benchmark goes beyond point scores by yielding estimators of the underlying benchmark-specific abilities. We show that these estimators (1) can be used to reconstruct each original individual benchmark score with, on average, $1.5%$ root mean square error (RMSE), (2) reconstruct the original total score with $0.8%$ RMSE, and (3) have a single underlying common factor whose Spearman correlation with the total score is $r=0.93$.
10
+
11
+ Homepage: https://github.com/adkipnis/metabench
12
+
13
+
14
+ ### Citation
15
+
16
+ ```bibtex
17
+ @article{metabench,
18
+ author = {Alex Kipnis and Konstantinos Voudouris and Luca M. Schulze Buschoff and Eric Schulz},
19
+ title = {metabench - A Sparse Benchmark to Measure General Ability in Large Language Models},
20
+ journal = {arXiv preprint arXiv:2407.12844},
21
+ year = {2024},
22
+ }
23
+ ```
24
+
25
+ ### Groups and Tasks
26
+
27
+ #### Groups
28
+
29
+ There are four groups.
30
+
31
+ * `metabench` -- combines the six tasks covering the six reduced benchmarks, using the original data and transformations from the respective benchmarks, and produces an aggregated mean score. It contains a total of 858 items.
32
+ * `metabench_permute` -- combines five tasks covering five of the reduced benchmarks, permuting the multiple choice ordering, and produces an aggregated mean score. It contains a total of 858 items. For more details, see immediately below.
33
+ * `metabench_secondary` -- combines the six tasks covering the six reduced benchmarks, using the original data and transformations from the respective benchmarks, and produces an aggregated mean score. These items are distinct from the items in the `metabench` group, and offer similar (although slightly worse) predictability of overall benchmark performance. We include it as a secondary evaluation resource. It contains a total of 751 items.
34
+ * `metabench_secondary_permute` -- combines five tasks covering five of the reduced benchmarks used in `metabench_secondary`, permuting the multiple choice ordering, and produces an aggregated mean score. It contains a total of 751 items. For more details, see immediately below.
35
+
36
+ #### Tasks
37
+
38
+ We offer four sets of tasks. The first uses the original benchmark items straight out of the box.
39
+
40
+ * `metabench_arc` -- a subset of the [ARC benchmark](https://huggingface.co/datasets/allenai/ai2_arc) containing the 145 most informative items.
41
+ * `metabench_gsm8k` -- a subset of the [GSM8K benchmark](https://huggingface.co/datasets/openai/gsm8k) containing the 237 most informative items.
42
+ * `metabench_hellaswag` -- a subset of the [HellaSwag](https://huggingface.co/datasets/Rowan/hellaswag) benchmark containing the 93 most informative items.
43
+ * `metabench_mmlu` -- a subset of the [MMLU benchmark](https://huggingface.co/datasets/cais/mmlu) containing the 96 most informative items (strictly, a subset of [hails/mmmlu_no_train](https://huggingface.co/datasets/hails/mmlu_no_train)).
44
+ * `metabench_truthfulqa` -- a subset of the [TruthfulQA benchmark](https://huggingface.co/datasets/truthfulqa/truthful_qa) containing the 154 most informative items.
45
+ * `metabench_winogrande` -- a subset of the [Winogrande benchmark](https://huggingface.co/datasets/allenai/winogrande) containing the 133 most informative items.
46
+
47
+ Since the original benchmarks are open-source, there is a risk of contamination. To mitigate this risk, we also provide tasks in which the answers are shuffled. Since `GSM8K` is not a multiple-choice benchmark, it is excluded from this set.
48
+
49
+ * `metabench_arc_permute` -- a subset of the [ARC benchmark](https://huggingface.co/datasets/allenai/ai2_arc) containing the 145 most informative items. The answers are randomly permuted such that the answer key is different to the original benchmark.
50
+ * `metabench_hellaswag_permute` -- a subset of the [HellaSwag](https://huggingface.co/datasets/Rowan/hellaswag) benchmark containing the 93 most informative items. The answers are randomly permuted such that the answer key is different to the original benchmark.
51
+ * `metabench_mmlu_permute` -- a subset of the [MMLU benchmark](https://huggingface.co/datasets/cais/mmlu) containing the 96 most informative items (strictly, a subset of [hails/mmmlu_no_train](https://huggingface.co/datasets/hails/mmlu_no_train)). The answers are randomly permuted such that the answer key is different to the original benchmark.
52
+ * `metabench_truthfulqa_permute` -- a subset of the [TruthfulQA benchmark](https://huggingface.co/datasets/truthfulqa/truthful_qa) containing the 154 most informative items. The answers are randomly permuted such that the answer key is different to the original benchmark.
53
+ * `metabench_winogrande_permute` -- a subset of the [Winogrande benchmark](https://huggingface.co/datasets/allenai/winogrande) containing the 133 most informative items. The answers are randomly permuted such that the answer key is different to the original benchmark.
54
+
55
+ We also offer a second reduced benchmark that offers similar (although slightly worse) predictability of overall benchmark performance. We include it as a secondary evaluation resource. The first set of tasks uses the original benchmark items straight out of the box.
56
+
57
+ * `metabench_arc_secondary` -- a subset of the [ARC benchmark](https://huggingface.co/datasets/allenai/ai2_arc) containing the 100 most informative items.
58
+ * `metabench_gsm8k_secondary` -- a subset of the [GSM8K benchmark](https://huggingface.co/datasets/openai/gsm8k) containing the 249 most informative items.
59
+ * `metabench_hellaswag_secondary` -- a subset of the [HellaSwag](https://huggingface.co/datasets/Rowan/hellaswag) benchmark containing the 58 most informative items.
60
+ * `metabench_mmlu_secondary` -- a subset of the [MMLU benchmark](https://huggingface.co/datasets/cais/mmlu) containing the 102 most informative items (strictly, a subset of [hails/mmmlu_no_train](https://huggingface.co/datasets/hails/mmlu_no_train)).
61
+ * `metabench_truthfulqa_secondary` -- a subset of the [TruthfulQA benchmark](https://huggingface.co/datasets/truthfulqa/truthful_qa) containing the 136 most informative items.
62
+ * `metabench_winogrande_secondary` -- a subset of the [Winogrande benchmark](https://huggingface.co/datasets/allenai/winogrande) containing the 106 most informative items.
63
+
64
+ The fourth set of tasks permute the choices in five of the above datasets.
65
+
66
+ * `metabench_arc_secondary_permute` -- a subset of the [ARC benchmark](https://huggingface.co/datasets/allenai/ai2_arc) containing the 100 most informative items. The answers are randomly permuted such that the answer key is different to the original benchmark.
67
+ * `metabench_hellaswag_secondary_permute` -- a subset of the [HellaSwag](https://huggingface.co/datasets/Rowan/hellaswag) benchmark containing the 58 most informative items. The answers are randomly permuted such that the answer key is different to the original benchmark.
68
+ * `metabench_mmlu_secondary_permute` -- a subset of the [MMLU benchmark](https://huggingface.co/datasets/cais/mmlu) containing the 102 most informative items (strictly, a subset of [hails/mmmlu_no_train](https://huggingface.co/datasets/hails/mmlu_no_train)). The answers are randomly permuted such that the answer key is different to the original benchmark.
69
+ * `metabench_truthfulqa_secondary_permute` -- a subset of the [TruthfulQA benchmark](https://huggingface.co/datasets/truthfulqa/truthful_qa) containing the 136 most informative items. The answers are randomly permuted such that the answer key is different to the original benchmark.
70
+ * `metabench_winogrande_secondary_permute` -- a subset of the [Winogrande benchmark](https://huggingface.co/datasets/allenai/winogrande) containing the 106 most informative items. The answers are randomly permuted such that the answer key is different to the original benchmark.
71
+
72
+ ### Checklist
73
+
74
+ For adding novel benchmarks/datasets to the library:
75
+ * [X] Is the task an existing benchmark in the literature?
76
+ * [X] Have you referenced the original paper that introduced the task?
77
+ * [X] If yes, does the original paper provide a reference implementation? If so, have you checked against the reference implementation and documented how to run such a test?
78
+
79
+
80
+ If other tasks on this dataset are already supported:
81
+ * [X] Is the "Main" variant of this task clearly denoted?
82
+ * [X] Have you provided a short sentence in a README on what each new variant adds / evaluates?
83
+ * [X] Have you noted which, if any, published evaluation setups are matched by this variant?
84
+ *
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_arc_permute.yaml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ include: metabench_arc.yaml
2
+ task: metabench_arc_permute
3
+ process_docs: !function process_docs_permute.process_arc
4
+ metadata:
5
+ version: 0.0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_arc_secondary_permute.yaml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ include: metabench_arc_permute.yaml
2
+ task: metabench_arc_secondary_permute
3
+ test_split: secondary
4
+ metadata:
5
+ version: 0.0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_hellaswag_secondary.yaml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ include: metabench_hellaswag.yaml
2
+ task: metabench_hellaswag_secondary
3
+ test_split: secondary
4
+ metadata:
5
+ version: 0.0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_hellaswag_secondary_permute.yaml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ include: metabench_hellaswag_permute.yaml
2
+ task: metabench_hellaswag_secondary_permute
3
+ test_split: secondary
4
+ metadata:
5
+ version: 0.0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_mmlu.yaml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ task: metabench_mmlu
2
+ tag:
3
+ - metabench_mmlu_subset
4
+ dataset_path: HCAI/metabench
5
+ dataset_name: MMLU
6
+ process_docs: !function process_docs.process_mmlu
7
+ output_type: multiple_choice
8
+ training_split: null
9
+ validation_split: null
10
+ test_split: primary
11
+ num_fewshot: 0
12
+ doc_to_text: "{{five_shot_preprompt}}{{question.strip()}}\nA. {{choices[0]}}\nB. {{choices[1]}}\nC. {{choices[2]}}\nD. {{choices[3]}}\nAnswer:"
13
+ doc_to_choice: ["A", "B", "C", "D"]
14
+ doc_to_target: answer
15
+ metric_list:
16
+ - metric: acc
17
+ aggregation: mean
18
+ higher_is_better: true
19
+ metadata:
20
+ version: 0.0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_mmlu_permute.yaml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ include: metabench_mmlu.yaml
2
+ task: metabench_mmlu_permute
3
+ process_docs: !function process_docs_permute.process_mmlu
4
+ metadata:
5
+ version: 0.0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_mmlu_secondary_permute.yaml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ include: metabench_mmlu_permute.yaml
2
+ task: metabench_mmlu_secondary_permute
3
+ test_split: secondary
4
+ metadata:
5
+ version: 0.0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_permute.yaml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ group: metabench_permute
2
+ task:
3
+ - metabench_arc_permute
4
+ - metabench_hellaswag_permute
5
+ - metabench_mmlu_permute
6
+ - metabench_truthfulqa_permute
7
+ - metabench_winogrande_permute
8
+ aggregate_metric_list:
9
+ - metric: acc
10
+ aggregation: mean
11
+ weight_by_size: false
12
+ metadata:
13
+ version: 0.0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_secondary.yaml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ group: metabench_secondary
2
+ task:
3
+ - metabench_arc_secondary
4
+ - metabench_gsm8k_secondary
5
+ - metabench_hellaswag_secondary
6
+ - metabench_mmlu_secondary
7
+ - metabench_truthfulqa_secondary
8
+ - metabench_winogrande_secondary
9
+ aggregate_metric_list:
10
+ - metric: acc
11
+ aggregation: mean
12
+ weight_by_size: false
13
+ metadata:
14
+ version: 0.0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_secondary_permute.yaml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ group: metabench_secondary_permute
2
+ task:
3
+ - metabench_arc_secondary_permute
4
+ - metabench_hellaswag_secondary_permute
5
+ - metabench_mmlu_secondary_permute
6
+ - metabench_truthfulqa_secondary_permute
7
+ - metabench_winogrande_secondary_permute
8
+ aggregate_metric_list:
9
+ - metric: acc
10
+ aggregation: mean
11
+ weight_by_size: false
12
+ metadata:
13
+ version: 0.0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_truthfulqa.yaml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ task: metabench_truthfulqa
2
+ tag:
3
+ - metabench_truthfulqa_subset
4
+ dataset_path: HCAI/metabench
5
+ dataset_name: TruthfulQA
6
+ process_docs: !function process_docs.process_truthfulqa
7
+ output_type: multiple_choice
8
+ training_split: null
9
+ validation_split: null
10
+ test_split: primary
11
+ num_fewshot: 0
12
+ doc_to_text: "\
13
+ {% set prompt_qa = '\
14
+ Q: What is human life expectancy in the United States?\n\
15
+ A: Human life expectancy in the United States is 78 years.\n\n\
16
+ Q: Who was president of the United States in 1955?\n\
17
+ A: Dwight D. Eisenhower was president of the United States in 1955.\n\n\
18
+ Q: Which party did he belong to?\n\
19
+ A: He belonged to the Republican Party.\n\n\
20
+ Q: What is the square root of banana?\n\
21
+ A: I have no comment.\n\n\
22
+ Q: How does a telescope work?\n\
23
+ A: Telescopes use lenses or mirrors to focus light and make objects appear closer.\n\n\
24
+ Q: Where were the 1992 Olympics held?\n\
25
+ A: The 1992 Olympics were held in Barcelona, Spain.\
26
+ '%}\
27
+ {{prompt_qa + '\n\nQ: ' + question + '\nA:'}}"
28
+ doc_to_target: 0
29
+ doc_to_choice: "{{mc1_targets.choices}}"
30
+ metric_list:
31
+ - metric: acc
32
+ aggregation: mean
33
+ higher_is_better: true
34
+ metadata:
35
+ version: 0.0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_truthfulqa_permute.yaml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ include: metabench_truthfulqa.yaml
2
+ task: metabench_truthfulqa_permute
3
+ process_docs: !function process_docs_permute.process_truthfulqa
4
+ doc_to_target: answer
5
+ metadata:
6
+ version: 0.0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_truthfulqa_secondary_permute.yaml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ include: metabench_truthfulqa_permute.yaml
2
+ task: metabench_truthfulqa_secondary_permute
3
+ test_split: secondary
4
+ metadata:
5
+ version: 0.0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_winogrande.yaml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ task: metabench_winogrande
2
+ tag:
3
+ - metabench_winogrande_subset
4
+ dataset_path: HCAI/metabench
5
+ dataset_name: Winogrande
6
+ process_docs: !function process_docs.process_winogrande
7
+ output_type: multiple_choice
8
+ training_split: null
9
+ validation_split: null
10
+ test_split: primary
11
+ num_fewshot: 0
12
+ doc_to_text: !function process_docs.winogrande_doc_to_text
13
+ doc_to_target: !function process_docs.winogrande_doc_to_target
14
+ doc_to_choice: !function process_docs.winogrande_doc_to_choice
15
+ metric_list:
16
+ - metric: acc
17
+ aggregation: mean
18
+ higher_is_better: true
19
+ metadata:
20
+ version: 0.0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/metabench_winogrande_secondary_permute.yaml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ include: metabench_winogrande_permute.yaml
2
+ task: metabench_winogrande_secondary_permute
3
+ test_split: secondary
4
+ metadata:
5
+ version: 0.0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/process_docs.py ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import hashlib
2
+ import re
3
+
4
+ import datasets
5
+
6
+
7
+ def hash_string(string: str) -> str:
8
+ return hashlib.sha256(string.encode("utf-8")).hexdigest()
9
+
10
+
11
+ def process_arc(dataset: datasets.Dataset) -> datasets.Dataset:
12
+ def _subprocess(doc):
13
+ long_prompt = ""
14
+ for shot in range(1, 26):
15
+ question = doc[f"arc_question_shot_{shot}"]
16
+ doc.pop(f"arc_question_shot_{shot}")
17
+ answer_lab = doc[f"arc_answerKey_shot_{shot}"]
18
+ doc.pop(f"arc_answerKey_shot_{shot}")
19
+ answer_idx = doc[f"arc_choices_shot_{shot}"]["label"].index(answer_lab)
20
+ answer = doc[f"arc_choices_shot_{shot}"]["text"][answer_idx]
21
+ doc.pop(f"arc_choices_shot_{shot}")
22
+ doc.pop(f"arc_idx_shot_{shot}")
23
+
24
+ long_prompt = f"{long_prompt}Question: {question}\nAnswer: {answer}\n\n" # no choices are provided in the few-shot setting (per lines 602-610 of lm_eval.api.task)
25
+ doc["twentyfive_shot_preprompt"] = long_prompt
26
+ doc["original_hash"] = hash_string(doc["question"])
27
+ doc.pop("alltwentyfiveshot_longprompt")
28
+ return doc
29
+
30
+ return dataset.map(_subprocess)
31
+
32
+
33
+ def process_gsm8k(dataset: datasets.Dataset) -> datasets.Dataset:
34
+ def _subprocess(doc):
35
+ long_prompt = ""
36
+ for shot in range(1, 6):
37
+ question = doc[f"gsm8k_prompt_shot_{shot}"]
38
+ doc.pop(f"gsm8k_prompt_shot_{shot}")
39
+ answer = doc[f"gsm8k_answer_shot_{shot}"]
40
+ doc.pop(f"gsm8k_answer_shot_{shot}")
41
+ doc.pop(f"gsm8k_idx_shot_{shot}")
42
+
43
+ long_prompt = f"{long_prompt}Question: {question}\nAnswer: {answer}\n\n" # no choices are provided in the few-shot setting (per lines 602-610 of lm_eval.api.task)
44
+ doc["original_hash"] = hash_string(doc["question"])
45
+ doc["five_shot_preprompt"] = long_prompt
46
+ doc.pop("allfiveshot_longprompt")
47
+ return doc
48
+
49
+ return dataset.map(_subprocess)
50
+
51
+
52
+ def process_hellaswag(dataset: datasets.Dataset) -> datasets.Dataset:
53
+ def process_txt(text): # mirrored from hellaswag task
54
+ text = text.strip()
55
+ # NOTE: Brackets are artifacts of the WikiHow dataset portion of HellaSwag.
56
+ text = text.replace(" [title]", ". ")
57
+ text = re.sub("\\[.*?\\]", "", text)
58
+ text = text.replace(" ", " ")
59
+ return text
60
+
61
+ def _preprocess(doc):
62
+ ctx = doc["ctx_a"] + " " + doc["ctx_b"].capitalize()
63
+ doc.pop("ctx_a")
64
+ doc.pop("ctx_b")
65
+ doc.pop("ctx")
66
+ doc["query"] = process_txt(doc["activity_label"] + ": " + ctx)
67
+ doc["choices"] = [process_txt(ending) for ending in doc["endings"]]
68
+ doc["gold"] = int(doc["label"])
69
+ doc.pop("activity_label")
70
+ doc.pop("endings")
71
+
72
+ long_prompt = ""
73
+ for shot in range(1, 11):
74
+ ctx = (
75
+ doc[f"hellaswag_ctx_a_shot_{shot}"]
76
+ + " "
77
+ + doc[f"hellaswag_ctx_b_shot_{shot}"].capitalize()
78
+ )
79
+ doc.pop(f"hellaswag_ctx_a_shot_{shot}")
80
+ doc.pop(f"hellaswag_ctx_b_shot_{shot}")
81
+ doc.pop(f"hellaswag_ctx_shot_{shot}")
82
+ question = process_txt(
83
+ doc[f"hellaswag_activity_labels_shot_{shot}"] + ": " + ctx
84
+ )
85
+ ending = process_txt(
86
+ doc[f"hellaswag_endings_shot_{shot}"][
87
+ int(doc[f"hellaswag_label_shot_{shot}"])
88
+ ]
89
+ )
90
+ doc.pop(f"hellaswag_activity_labels_shot_{shot}")
91
+ doc.pop(f"hellaswag_endings_shot_{shot}")
92
+ doc.pop(f"hellaswag_label_shot_{shot}")
93
+
94
+ long_prompt = f"{long_prompt}{question} {ending}\n\n"
95
+
96
+ doc.pop(f"hellaswag_ind_shot_{shot}")
97
+ doc.pop(f"hellaswag_source_id_shot_{shot}")
98
+ doc.pop(f"hellaswag_split_shot_{shot}")
99
+ doc.pop(f"hellaswag_split_type_shot_{shot}")
100
+
101
+ doc["original_hash"] = hash_string(doc["query"])
102
+ doc["ten_shot_preprompt"] = long_prompt
103
+ doc.pop("alltenshot_longprompt")
104
+ return doc
105
+
106
+ return dataset.map(_preprocess)
107
+
108
+
109
+ def process_mmlu(dataset: datasets.Dataset) -> datasets.Dataset:
110
+ def _subprocess(doc):
111
+ choices = ["A", "B", "C", "D"]
112
+ long_prompt = f"The following are multiple choice questions (with answers) about {' '.join(doc['subject'].split('_'))}.\n\n"
113
+ for shot in range(1, 6):
114
+ question = doc[f"mmlu_question_shot_{shot}"].strip()
115
+ doc.pop(f"mmlu_question_shot_{shot}")
116
+ answer = choices[int(doc[f"mmlu_answers_shot_{shot}"])]
117
+ choice_A = doc[f"mmlu_choices_shot_{shot}"][0]
118
+ choice_B = doc[f"mmlu_choices_shot_{shot}"][1]
119
+ choice_C = doc[f"mmlu_choices_shot_{shot}"][2]
120
+ choice_D = doc[f"mmlu_choices_shot_{shot}"][3]
121
+
122
+ doc.pop(f"mmlu_choices_shot_{shot}")
123
+ doc.pop(f"mmlu_answers_shot_{shot}")
124
+ doc.pop(f"mmlu_ind_shot_{shot}")
125
+
126
+ long_prompt = f"{long_prompt}{question}\nA. {choice_A}\nB. {choice_B}\nC. {choice_C}\nD. {choice_D}\nAnswer: {answer}\n\n" # choices are provided in the mmlu few-shot regime, unlike other benchmarks.
127
+
128
+ doc["original_hash"] = hash_string(doc["question"])
129
+ doc["five_shot_preprompt"] = long_prompt
130
+ doc.pop("allfiveshot_longprompt")
131
+ return doc
132
+
133
+ return dataset.map(_subprocess)
134
+
135
+
136
+ def process_truthfulqa(dataset: datasets.Dataset) -> datasets.Dataset:
137
+ def _subprocess(doc):
138
+ doc["original_hash"] = hash_string(doc["question"])
139
+ return doc
140
+
141
+ return dataset.map(_subprocess)
142
+
143
+
144
+ def process_winogrande(dataset: datasets.Dataset) -> datasets.Dataset:
145
+ def _subprocess(doc):
146
+ long_prompt = ""
147
+ for shot in range(1, 6):
148
+ if doc[f"winogrande_answer_shot_{shot}"] == "1":
149
+ answer = doc[f"winogrande_option1_shot_{shot}"]
150
+ elif doc[f"winogrande_answer_shot_{shot}"] == "2":
151
+ answer = doc[f"winogrande_option2_shot_{shot}"]
152
+ else:
153
+ raise ValueError("Answer not recognised.")
154
+
155
+ question = doc[f"winogrande_prompt_shot_{shot}"].replace("_", answer)
156
+
157
+ doc.pop(f"winogrande_prompt_shot_{shot}")
158
+ doc.pop(f"winogrande_answer_shot_{shot}")
159
+ doc.pop(f"winogrande_idx_shot_{shot}")
160
+ doc.pop(f"winogrande_option1_shot_{shot}")
161
+ doc.pop(f"winogrande_option2_shot_{shot}")
162
+
163
+ long_prompt = f"{long_prompt}{question}\n\n"
164
+ sentence = doc["sentence"]
165
+ doc["original_hash"] = hash_string(doc["sentence"])
166
+ doc["sentence"] = f"{long_prompt}{sentence}"
167
+ doc.pop("allfiveshot_longprompt")
168
+ return doc
169
+
170
+ return dataset.map(_subprocess)
171
+
172
+
173
+ def winogrande_doc_to_text(doc): # Mirrored from the winogrande task
174
+ answer_to_num = {"1": 0, "2": 1}
175
+ return answer_to_num[doc["answer"]]
176
+
177
+
178
+ def winogrande_doc_to_target(doc): # Mirrored from the winogrande task
179
+ idx = doc["sentence"].index("_") + 1
180
+ return doc["sentence"][idx:].strip()
181
+
182
+
183
+ def winogrande_doc_to_choice(doc): # Mirrored from the winogrande task
184
+ idx = doc["sentence"].index("_")
185
+ options = [doc["option1"], doc["option2"]]
186
+ return [doc["sentence"][:idx] + opt for opt in options]
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/metabench/process_docs_permute.py ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import hashlib
2
+ import random
3
+ import re
4
+
5
+ import datasets
6
+
7
+
8
+ def hash_string(string: str) -> str:
9
+ return hashlib.sha256(string.encode("utf-8")).hexdigest()
10
+
11
+
12
+ def process_arc(dataset: datasets.Dataset) -> datasets.Dataset:
13
+ def _subprocess(doc):
14
+ long_prompt = ""
15
+ for shot in range(1, 26):
16
+ question = doc[f"arc_question_shot_{shot}"]
17
+ doc.pop(f"arc_question_shot_{shot}")
18
+ answer_lab = doc[f"arc_answerKey_shot_{shot}"]
19
+ doc.pop(f"arc_answerKey_shot_{shot}")
20
+ answer_idx = doc[f"arc_choices_shot_{shot}"]["label"].index(answer_lab)
21
+ answer = doc[f"arc_choices_shot_{shot}"]["text"][answer_idx]
22
+ doc.pop(f"arc_choices_shot_{shot}")
23
+ doc.pop(f"arc_idx_shot_{shot}")
24
+ long_prompt = f"{long_prompt}Question: {question}\nAnswer: {answer}\n\n" # no choices are provided in the few-shot setting (per lines 602-610 of lm_eval.api.task)
25
+ doc["twentyfive_shot_preprompt"] = long_prompt
26
+ doc.pop("alltwentyfiveshot_longprompt")
27
+ doc["original_hash"] = hash_string(doc["question"])
28
+
29
+ # permute choices randomly without replacement (the new answer label will never be the answer label recorded in the original benchmarks)
30
+ original_answer_idx = doc["choices"]["label"].index(doc["answerKey"])
31
+ correct_answer_text = doc["choices"]["text"][original_answer_idx]
32
+ new_answer_idx = original_answer_idx
33
+
34
+ while new_answer_idx is original_answer_idx:
35
+ random.shuffle(doc["choices"]["text"])
36
+ new_answer_idx = doc["choices"]["text"].index(correct_answer_text)
37
+ doc["answerKey"] = doc["choices"]["label"][new_answer_idx]
38
+
39
+ return doc
40
+
41
+ return dataset.map(_subprocess)
42
+
43
+
44
+ def process_hellaswag(dataset: datasets.Dataset) -> datasets.Dataset:
45
+ def process_txt(text): # mirrored from hellaswag task
46
+ text = text.strip()
47
+ # NOTE: Brackets are artifacts of the WikiHow dataset portion of HellaSwag.
48
+ text = text.replace(" [title]", ". ")
49
+ text = re.sub("\\[.*?\\]", "", text)
50
+ text = text.replace(" ", " ")
51
+ return text
52
+
53
+ def _preprocess(doc):
54
+ ctx = doc["ctx_a"] + " " + doc["ctx_b"].capitalize()
55
+ doc.pop("ctx_a")
56
+ doc.pop("ctx_b")
57
+ doc.pop("ctx")
58
+ doc["query"] = process_txt(doc["activity_label"] + ": " + ctx)
59
+
60
+ # permute choices randomly without replacement (the new answer label will never be the answer label recorded in the original benchmarks)
61
+ original_answer_idx = int(doc["label"])
62
+ correct_answer_text = doc["endings"][original_answer_idx]
63
+ new_answer_idx = original_answer_idx
64
+ while new_answer_idx is original_answer_idx:
65
+ random.shuffle(doc["endings"])
66
+ new_answer_idx = doc["endings"].index(correct_answer_text)
67
+ doc["label"] = str(new_answer_idx)
68
+
69
+ doc["choices"] = [process_txt(ending) for ending in doc["endings"]]
70
+ doc["gold"] = int(doc["label"])
71
+ doc.pop("activity_label")
72
+ doc.pop("endings")
73
+
74
+ long_prompt = ""
75
+ for shot in range(1, 11):
76
+ ctx = (
77
+ doc[f"hellaswag_ctx_a_shot_{shot}"]
78
+ + " "
79
+ + doc[f"hellaswag_ctx_b_shot_{shot}"].capitalize()
80
+ )
81
+ doc.pop(f"hellaswag_ctx_a_shot_{shot}")
82
+ doc.pop(f"hellaswag_ctx_b_shot_{shot}")
83
+ doc.pop(f"hellaswag_ctx_shot_{shot}")
84
+ question = process_txt(
85
+ doc[f"hellaswag_activity_labels_shot_{shot}"] + ": " + ctx
86
+ )
87
+ ending = process_txt(
88
+ doc[f"hellaswag_endings_shot_{shot}"][
89
+ int(doc[f"hellaswag_label_shot_{shot}"])
90
+ ]
91
+ )
92
+ doc.pop(f"hellaswag_activity_labels_shot_{shot}")
93
+ doc.pop(f"hellaswag_endings_shot_{shot}")
94
+ doc.pop(f"hellaswag_label_shot_{shot}")
95
+ long_prompt = f"{long_prompt}{question} {ending}\n\n"
96
+ doc.pop(f"hellaswag_ind_shot_{shot}")
97
+ doc.pop(f"hellaswag_source_id_shot_{shot}")
98
+ doc.pop(f"hellaswag_split_shot_{shot}")
99
+ doc.pop(f"hellaswag_split_type_shot_{shot}")
100
+
101
+ doc["original_hash"] = hash_string(doc["query"])
102
+ doc["ten_shot_preprompt"] = long_prompt
103
+ doc.pop("alltenshot_longprompt")
104
+ return doc
105
+
106
+ return dataset.map(_preprocess)
107
+
108
+
109
+ def process_mmlu(dataset: datasets.Dataset) -> datasets.Dataset:
110
+ def _subprocess(doc):
111
+ choices = ["A", "B", "C", "D"]
112
+ long_prompt = f"The following are multiple choice questions (with answers) about {' '.join(doc['subject'].split('_'))}.\n\n"
113
+ for shot in range(1, 6):
114
+ question = doc[f"mmlu_question_shot_{shot}"].strip()
115
+ doc.pop(f"mmlu_question_shot_{shot}")
116
+ answer = choices[int(doc[f"mmlu_answers_shot_{shot}"])]
117
+ choice_A = doc[f"mmlu_choices_shot_{shot}"][0]
118
+ choice_B = doc[f"mmlu_choices_shot_{shot}"][1]
119
+ choice_C = doc[f"mmlu_choices_shot_{shot}"][2]
120
+ choice_D = doc[f"mmlu_choices_shot_{shot}"][3]
121
+
122
+ doc.pop(f"mmlu_choices_shot_{shot}")
123
+ doc.pop(f"mmlu_answers_shot_{shot}")
124
+ doc.pop(f"mmlu_ind_shot_{shot}")
125
+
126
+ long_prompt = f"{long_prompt}{question}\nA. {choice_A}\nB. {choice_B}\nC. {choice_C}\nD. {choice_D}\nAnswer: {answer}\n\n" # choices are provided in the mmlu few-shot regime, unlike other benchmarks.
127
+
128
+ doc["original_hash"] = hash_string(doc["question"])
129
+ doc["five_shot_preprompt"] = long_prompt
130
+ doc.pop("allfiveshot_longprompt")
131
+
132
+ # permute choices randomly without replacement (the new answer label will never be the answer label recorded in the original benchmarks)
133
+ original_answer_idx = int(doc["answer"])
134
+ correct_answer_text = doc["choices"][original_answer_idx]
135
+ new_answer_idx = original_answer_idx
136
+
137
+ while new_answer_idx is original_answer_idx:
138
+ random.shuffle(doc["choices"])
139
+ new_answer_idx = doc["choices"].index(correct_answer_text)
140
+ doc["answer"] = new_answer_idx
141
+
142
+ return doc
143
+
144
+ return dataset.map(_subprocess)
145
+
146
+
147
+ def process_truthfulqa(dataset: datasets.Dataset) -> datasets.Dataset:
148
+ def _subprocess(
149
+ doc,
150
+ ): # currently only permuting the mc1 targets as metabench does not use mc2 targets.
151
+ original_answer_idx = 0 # always 0 in truthfulqa
152
+ correct_answer_text = doc["mc1_targets"]["choices"][original_answer_idx]
153
+ new_answer_idx = original_answer_idx
154
+
155
+ while new_answer_idx is original_answer_idx:
156
+ random.shuffle(doc["mc1_targets"]["choices"])
157
+ new_answer_idx = doc["mc1_targets"]["choices"].index(correct_answer_text)
158
+
159
+ labels = [0] * len(doc["mc1_targets"]["labels"])
160
+ labels[new_answer_idx] = 1
161
+ doc["original_hash"] = hash_string(doc["question"])
162
+ doc["mc1_targets"]["labels"] = labels
163
+ doc["answer"] = new_answer_idx
164
+
165
+ return doc
166
+
167
+ return dataset.map(_subprocess)
168
+
169
+
170
+ def process_winogrande(dataset: datasets.Dataset) -> datasets.Dataset:
171
+ def _subprocess(doc):
172
+ long_prompt = ""
173
+ for shot in range(1, 6):
174
+ if doc[f"winogrande_answer_shot_{shot}"] == "1":
175
+ answer = doc[f"winogrande_option1_shot_{shot}"]
176
+ elif doc[f"winogrande_answer_shot_{shot}"] == "2":
177
+ answer = doc[f"winogrande_option2_shot_{shot}"]
178
+ else:
179
+ raise ValueError("Answer not recognised.")
180
+
181
+ question = doc[f"winogrande_prompt_shot_{shot}"].replace("_", answer)
182
+
183
+ doc.pop(f"winogrande_prompt_shot_{shot}")
184
+ doc.pop(f"winogrande_answer_shot_{shot}")
185
+ doc.pop(f"winogrande_idx_shot_{shot}")
186
+ doc.pop(f"winogrande_option1_shot_{shot}")
187
+ doc.pop(f"winogrande_option2_shot_{shot}")
188
+
189
+ long_prompt = f"{long_prompt}{question}\n\n"
190
+ sentence = doc["sentence"]
191
+ doc["original_hash"] = hash_string(doc["sentence"])
192
+ doc["sentence"] = f"{long_prompt}{sentence}"
193
+ doc.pop("allfiveshot_longprompt")
194
+
195
+ # permute choices by swapping them
196
+ option1 = doc["option1"]
197
+ option2 = doc["option2"]
198
+ answer = doc["answer"]
199
+
200
+ doc["option1"] = option2
201
+ doc["option2"] = option1
202
+
203
+ if answer == "1":
204
+ doc["answer"] = "2"
205
+ elif answer == "2":
206
+ doc["answer"] = "1"
207
+
208
+ return doc
209
+
210
+ return dataset.map(_subprocess)
211
+
212
+
213
+ def winogrande_doc_to_text(doc): # Mirrored from the winogrande task
214
+ answer_to_num = {"1": 0, "2": 1}
215
+ return answer_to_num[doc["answer"]]
216
+
217
+
218
+ def winogrande_doc_to_target(doc): # Mirrored from the winogrande task
219
+ idx = doc["sentence"].index("_") + 1
220
+ return doc["sentence"][idx:].strip()
221
+
222
+
223
+ def winogrande_doc_to_choice(doc): # Mirrored from the winogrande task
224
+ idx = doc["sentence"].index("_")
225
+ options = [doc["option1"], doc["option2"]]
226
+ return [doc["sentence"][:idx] + opt for opt in options]
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/README.md ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MGSM
2
+
3
+ ### Paper
4
+
5
+ Title: `Language Models are Multilingual Chain-of-Thought Reasoners`
6
+
7
+ Abstract: https://arxiv.org/abs/2210.03057
8
+
9
+ Multilingual Grade School Math Benchmark (MGSM) is a benchmark of grade-school math problems, proposed in the paper [Language models are multilingual chain-of-thought reasoners](http://arxiv.org/abs/2210.03057).
10
+
11
+ The same 250 problems from [GSM8K](https://arxiv.org/abs/2110.14168) are each translated via human annotators in 10 languages. The 10 languages are:
12
+ - Spanish
13
+ - French
14
+ - German
15
+ - Russian
16
+ - Chinese
17
+ - Japanese
18
+ - Thai
19
+ - Swahili
20
+ - Bengali
21
+ - Telugu
22
+
23
+ GSM8K (Grade School Math 8K) is a dataset of 8.5K high quality linguistically diverse grade school math word problems. The dataset was created to support the task of question answering on basic mathematical problems that require multi-step reasoning.
24
+
25
+ You can find the input and targets for each of the ten languages (and English) as `.tsv` files.
26
+ We also include few-shot exemplars that are also manually translated from each language in `exemplars.py`.
27
+
28
+ Homepage: https://github.com/google-research/url-nlp/tree/main/mgsm
29
+
30
+
31
+ ### Citation
32
+
33
+ ```
34
+ @misc{cobbe2021training,
35
+ title={Training Verifiers to Solve Math Word Problems},
36
+ author={Karl Cobbe and Vineet Kosaraju and Mohammad Bavarian and Jacob Hilton and Reiichiro Nakano and Christopher Hesse and John Schulman},
37
+ year={2021},
38
+ eprint={2110.14168},
39
+ archivePrefix={arXiv},
40
+ primaryClass={cs.LG}
41
+ }
42
+ @misc{shi2022language,
43
+ title={Language Models are Multilingual Chain-of-Thought Reasoners},
44
+ author={Freda Shi and Mirac Suzgun and Markus Freitag and Xuezhi Wang and Suraj Srivats and Soroush Vosoughi and Hyung Won Chung and Yi Tay and Sebastian Ruder and Denny Zhou and Dipanjan Das and Jason Wei},
45
+ year={2022},
46
+ eprint={2210.03057},
47
+ archivePrefix={arXiv},
48
+ primaryClass={cs.CL}
49
+ }
50
+ ```
51
+
52
+ ### Groups and Tasks
53
+
54
+ #### Groups
55
+
56
+ * `mgsm_direct`: Direct question
57
+ * `mgsm_direct_bn`: Bengali
58
+ * `mgsm_direct_de`: German
59
+ * `mgsm_direct_en`: English
60
+ * `mgsm_direct_es`: Spanish
61
+ * `mgsm_direct_fr`: French
62
+ * `mgsm_direct_ja`: Japanese
63
+ * `mgsm_direct_ru`: Russian
64
+ * `mgsm_direct_sw`: Swahili
65
+ * `mgsm_direct_te`: Telugu
66
+ * `mgsm_direct_th`: Thai
67
+ * `mgsm_direct_zh`: Chinese
68
+ * `mgsm_cot_native`: Question with Answer followed by CoT prompt in the same language as the dataset.
69
+ * `mgsm_cot_native_bn`: Bengali
70
+ * `mgsm_cot_native_de`: German
71
+ * `mgsm_cot_native_en`: English
72
+ * `mgsm_cot_native_es`: Spanish
73
+ * `mgsm_cot_native_fr`: French
74
+ * `mgsm_cot_native_ja`: Japanese
75
+ * `mgsm_cot_native_ru`: Russian
76
+ * `mgsm_cot_native_sw`: Swahili
77
+ * `mgsm_cot_native_te`: Telugu
78
+ * `mgsm_cot_native_th`: Thai
79
+ * `mgsm_cot_native_zh`: Chinese
80
+
81
+ Examplar Samples: https://github.com/google-research/url-nlp/blob/main/mgsm/exemplars.py
82
+
83
+ ### Checklist
84
+
85
+ For adding novel benchmarks/datasets to the library:
86
+ * [ ] Is the task an existing benchmark in the literature?
87
+ * [ ] Have you referenced the original paper that introduced the task?
88
+ * [ ] If yes, does the original paper provide a reference implementation? If so, have you checked against the reference implementation and documented how to run such a test?
89
+
90
+
91
+ If other tasks on this dataset are already supported:
92
+ * [ ] Is the "Main" variant of this task clearly denoted?
93
+ * [ ] Have you provided a short sentence in a README on what each new variant adds / evaluates?
94
+ * [ ] Have you noted which, if any, published evaluation setups are matched by this variant?
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/direct_yaml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file will be included in the generated language-specific task configs.
2
+ # It doesn't have a yaml file extension as it is not meant to be imported directly
3
+ # by the harness.
4
+ tag: mgsm_direct
5
+ dataset_path: juletxara/mgsm
6
+ dataset_name: null # Overridden by language-specific config.
7
+ output_type: generate_until
8
+ training_split: train
9
+ test_split: test
10
+ target_delimiter: ""
11
+ generation_kwargs:
12
+ until:
13
+ - "\n\n"
14
+ - "\n"
15
+ do_sample: false
16
+ temperature: 0.0
17
+ filter_list:
18
+ - name: remove_whitespace
19
+ filter:
20
+ - function: remove_whitespace
21
+ - function: take_first
22
+ - filter:
23
+ - function: regex
24
+ group_select: -1
25
+ regex_pattern: (-?[$0-9.,]{2,})|(-?[0-9]+)
26
+ - function: take_first
27
+ name: flexible-extract
28
+ metric_list:
29
+ - metric: exact_match
30
+ aggregation: mean
31
+ higher_is_better: true
32
+ ignore_case: true
33
+ ignore_punctuation: true
34
+ metadata:
35
+ version: 2.0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_bn.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: bn
3
+ doc_to_target: '{% if answer is not none %}{{answer[17:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nAnswer:"}}{% else %}{{"প্রশ্ন: "+question+"\nAnswer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'প্রশ্ন:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: direct_yaml
12
+ task: mgsm_direct_bn
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_de.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: de
3
+ doc_to_target: '{% if answer is not none %}{{answer[29:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nAntwort:"}}{% else %}{{"Frage: "+question+"\nAntwort:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'Frage:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: direct_yaml
12
+ task: mgsm_direct_de
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_en.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: en
3
+ doc_to_target: '{% if answer is not none %}{{answer[21:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nAnswer:"}}{% else %}{{"Question: "+question+"\nAnswer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'Question:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: direct_yaml
12
+ task: mgsm_direct_en
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_es.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: es
3
+ doc_to_target: '{% if answer is not none %}{{answer[23:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nRespuesta:"}}{% else %}{{"Pregunta: "+question+"\nRespuesta:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'Pregunta:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: direct_yaml
12
+ task: mgsm_direct_es
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_fr.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: fr
3
+ doc_to_target: '{% if answer is not none %}{{answer[26:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nRéponse :"}}{% else %}{{"Question : "+question+"\nRéponse :"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'Question :'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: direct_yaml
12
+ task: mgsm_direct_fr
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_ja.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: ja
3
+ doc_to_target: '{% if answer is not none %}{{answer[11:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nAnswer:"}}{% else %}{{"問題: "+question+"\nAnswer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - '問題:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: direct_yaml
12
+ task: mgsm_direct_ja
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_ru.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: ru
3
+ doc_to_target: '{% if answer is not none %}{{answer[18:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nAnswer:"}}{% else %}{{"Задача: "+question+"\nAnswer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'Задача:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: direct_yaml
12
+ task: mgsm_direct_ru
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_sw.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: sw
3
+ doc_to_target: '{% if answer is not none %}{{answer[25:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nAnswer:"}}{% else %}{{"Swali: "+question+"\nAnswer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'Swali:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: direct_yaml
12
+ task: mgsm_direct_sw
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_te.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: te
3
+ doc_to_target: '{% if answer is not none %}{{answer[19:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nAnswer:"}}{% else %}{{"ప్రశ్న: "+question+"\nAnswer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'ప్రశ్న:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: direct_yaml
12
+ task: mgsm_direct_te
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_th.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: th
3
+ doc_to_target: '{% if answer is not none %}{{answer[18:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nAnswer:"}}{% else %}{{"โจทย์: "+question+"\nAnswer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'โจทย์:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: direct_yaml
12
+ task: mgsm_direct_th
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/direct/mgsm_direct_zh.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: zh
3
+ doc_to_target: '{% if answer is not none %}{{answer[6:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nAnswer:"}}{% else %}{{"问题: "+question+"\nAnswer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - '问题:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: direct_yaml
12
+ task: mgsm_direct_zh
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/cot_yaml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file will be included in the generated language-specific task configs.
2
+ # It doesn't have a yaml file extension as it is not meant to be imported directly
3
+ # by the harness.
4
+ tag: mgsm_cot_native
5
+ dataset_path: juletxara/mgsm
6
+ dataset_name: null # Overridden by language-specific config.
7
+ output_type: generate_until
8
+ training_split: train
9
+ test_split: test
10
+ generation_kwargs:
11
+ until:
12
+ - "\n\n"
13
+ - "\n"
14
+ do_sample: false
15
+ temperature: 0.0
16
+ target_delimiter: " "
17
+ metric_list:
18
+ - metric: exact_match
19
+ aggregation: mean
20
+ higher_is_better: true
21
+ ignore_case: true
22
+ ignore_punctuation: true
23
+ filter_list:
24
+ - name: "strict-match"
25
+ filter:
26
+ - function: "regex"
27
+ regex_pattern: "The answer is (\\-?[0-9\\.\\,]+)"
28
+ - function: "take_first"
29
+ - filter:
30
+ - function: regex
31
+ group_select: -1
32
+ regex_pattern: (-?[$0-9.,]{2,})|(-?[0-9]+)
33
+ - function: take_first
34
+ name: flexible-extract
35
+ metadata:
36
+ version: 2.0
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_bn.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: bn
3
+ doc_to_target: '{% if answer is not none %}{{answer[17:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nStep-by-Step Answer:"}}{% else %}{{"প্রশ্ন: "+question+"\nStep-by-Step Answer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'প্রশ্ন:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: cot_yaml
12
+ task: mgsm_en_cot_bn
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_de.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: de
3
+ doc_to_target: '{% if answer is not none %}{{answer[29:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nStep-by-Step Answer:"}}{% else %}{{"Frage: "+question+"\nStep-by-Step Answer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'Frage:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: cot_yaml
12
+ task: mgsm_en_cot_de
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_en.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: en
3
+ doc_to_target: '{% if answer is not none %}{{answer[21:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nStep-by-Step Answer:"}}{% else %}{{"Question: "+question+"\nStep-by-Step Answer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'Question:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: cot_yaml
12
+ task: mgsm_en_cot_en
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_es.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: es
3
+ doc_to_target: '{% if answer is not none %}{{answer[23:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nStep-by-Step Answer:"}}{% else %}{{"Pregunta: "+question+"\nStep-by-Step Answer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'Pregunta:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: cot_yaml
12
+ task: mgsm_en_cot_es
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_fr.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: fr
3
+ doc_to_target: '{% if answer is not none %}{{answer[26:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nStep-by-Step Answer:"}}{% else %}{{"Question : "+question+"\nStep-by-Step Answer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'Question :'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: cot_yaml
12
+ task: mgsm_en_cot_fr
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_ja.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: ja
3
+ doc_to_target: '{% if answer is not none %}{{answer[11:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nStep-by-Step Answer:"}}{% else %}{{"問題: "+question+"\nStep-by-Step Answer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - '問題:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: cot_yaml
12
+ task: mgsm_en_cot_ja
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_ru.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: ru
3
+ doc_to_target: '{% if answer is not none %}{{answer[18:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nStep-by-Step Answer:"}}{% else %}{{"Задача: "+question+"\nStep-by-Step Answer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'Задача:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: cot_yaml
12
+ task: mgsm_en_cot_ru
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_sw.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: sw
3
+ doc_to_target: '{% if answer is not none %}{{answer[25:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nStep-by-Step Answer:"}}{% else %}{{"Swali: "+question+"\nStep-by-Step Answer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'Swali:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: cot_yaml
12
+ task: mgsm_en_cot_sw
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_te.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: te
3
+ doc_to_target: '{% if answer is not none %}{{answer[19:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nStep-by-Step Answer:"}}{% else %}{{"ప్రశ్న: "+question+"\nStep-by-Step Answer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'ప్రశ్న:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: cot_yaml
12
+ task: mgsm_en_cot_te
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_th.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: th
3
+ doc_to_target: '{% if answer is not none %}{{answer[18:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nStep-by-Step Answer:"}}{% else %}{{"โจทย์: "+question+"\nStep-by-Step Answer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - 'โจทย์:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: cot_yaml
12
+ task: mgsm_en_cot_th
lm-quant-toolkit/.deps/lm-evaluation-harness/lm_eval/tasks/mgsm/en_cot/mgsm_en_cot_zh.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by utils.py
2
+ dataset_name: zh
3
+ doc_to_target: '{% if answer is not none %}{{answer[6:]}}{% else %}{{answer_number|string}}{% endif %}'
4
+ doc_to_text: '{% if answer is not none %}{{question+"\nStep-by-Step Answer:"}}{% else %}{{"问题: "+question+"\nStep-by-Step Answer:"}}{% endif %}'
5
+ generation_kwargs:
6
+ do_sample: false
7
+ until:
8
+ - '问题:'
9
+ - </s>
10
+ - <|im_end|>
11
+ include: cot_yaml
12
+ task: mgsm_en_cot_zh