Skip to content

Commit

Permalink
fix some bugs of mmlu (#2299)
Browse files Browse the repository at this point in the history
* fix some bugs of mmlu

* Fix end of file newline issue

---------

Co-authored-by: eyuansu62 <[email protected]>
  • Loading branch information
eyuansu62 and eyuansu62 authored Sep 28, 2024
1 parent 1bc6c93 commit 5a48ca2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion lm_eval/tasks/mmlu/flan_cot_fewshot/_mmlu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ task:
- metric: acc
weight_by_size: True
aggregate_metric_list:
- metric: acc
- aggregation: mean
metric: exact_match
weight_by_size: True
filter_list: get-answer
metadata:
version: 2
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
dataset_path: hails/mmlu_no_train # a copy of `cais/mmlu` with no auxiliary_train split
validation_split: validation
test_split: test
fewshot_split: dev
fewshot_config:
sampler: first_n
output_type: generate_until
doc_to_text: "Q: {{question.strip()}}\n(A) {{choices[0]}} (B) {{choices[1]}} (C) {{choices[2]}} (D) {{choices[3]}}\nA: Let's think step by step."
doc_to_target: "{{['(A)', '(B)', '(C)', '(D)'][answer]}}"
doc_to_text: "{% if choices is defined%}Q: {{question.strip()}}\n(A) {{choices[0]}} (B) {{choices[1]}} (C) {{choices[2]}} (D) {{choices[3]}}\nA: Let's think step by step.{% else %}Q: {{ question.strip() }}\nA:{% endif %}"
doc_to_target: "{{['(A)', '(B)', '(C)', '(D)'][answer] if answer is defined else target}}"
filter_list:
- name: "get-answer"
filter:
Expand All @@ -18,7 +17,7 @@ generation_kwargs:
- "</s>"
do_sample: false
temperature: 0.0
num_fewshot: 0
num_fewshot: 4
metric_list:
- metric: exact_match
aggregation: mean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ filter_list:
- function: "take_first"
- name: "flexible-extract"
filter:
- function: !function utils.MultiChoiceRegexFilter
- function: "multi_choice_regex"
group_select: 0
regex_pattern: "(\\([A-Z]\\))"
ignore_case: true
Expand Down

0 comments on commit 5a48ca2

Please sign in to comment.