Commit 88486e57 authored by lintangsutawika's avatar lintangsutawika
Browse files

Merge branch 'group-agg-rework' of...

Merge branch 'group-agg-rework' of https://github.com/EleutherAI/lm-evaluation-harness into multiprompt
parents 5971f2ca ba73d131
dataset_path: TIGER-Lab/MMLU-Pro # a copy of `cais/leaderboard_mmlu` with no auxiliary_train split
task: leaderboard_mmlu_pro
test_split: test
fewshot_split: validation
fewshot_config:
sampler: first_n
output_type: multiple_choice
doc_to_text: !function utils.doc_to_text
doc_to_choice: !function utils.doc_to_choice
doc_to_target: answer
metric_list:
- metric: acc
aggregation: mean
higher_is_better: true
num_fewshot: 5
metadata:
version: 0.1
import string
def doc_to_text(doc):
doc_to_text = f"{doc['question']}\n"
for i in range(len(doc["options"])):
doc_to_text += f"{string.ascii_uppercase[i]}. {doc['options'][i]}\n"
doc_to_text += "Answer:"
return doc_to_text
def doc_to_choice(doc):
return [string.ascii_uppercase[i] for i in range(len(doc["options"]))]
group: leaderboard_musr
task:
- leaderboard_musr_murder_mysteries
- leaderboard_musr_object_placements
- leaderboard_musr_team_allocation
dataset_path: TAUR-Lab/MuSR
output_type: multiple_choice
doc_to_text: !function utils.doc_to_text
doc_to_target: "{{answer_choice}}"
doc_to_choice: "{{choices}}"
metric_list:
- metric: acc_norm
aggregation: mean
higher_is_better: true
metadata:
version: 1.0
include: "_template_yaml"
task: leaderboard_musr_murder_mysteries
test_split: murder_mysteries
include: "_template_yaml"
task: leaderboard_musr_object_placements
test_split: object_placements
include: "_template_yaml"
task: leaderboard_musr_team_allocation
test_split: team_allocation
import ast
def doc_to_choice(doc):
"""
Convert a doc to a choice.
"""
return ast.literal_eval(doc["choices"])
DOC_TO_TEXT = "{narrative}\n\n" "{question}\n\n" "{choices}\n" "Answer:"
def doc_to_text(doc):
"""
Convert a doc to text.
"""
choices = ""
for i, choice in enumerate(ast.literal_eval(doc["choices"])):
choices += f"{i+1} - {choice}\n"
text = DOC_TO_TEXT.format(
narrative=doc["narrative"], question=doc["question"], choices=choices
)
return text
group: tag:
- math_word_problems - math_word_problems
task: mathqa task: mathqa
dataset_path: math_qa dataset_path: math_qa
......
""" """
Take in a YAML, and output all "other" splits with this YAML Take in a YAML, and output all "other" splits with this YAML
""" """
import argparse import argparse
import logging import logging
import os import os
...@@ -109,10 +110,9 @@ if __name__ == "__main__": ...@@ -109,10 +110,9 @@ if __name__ == "__main__":
yaml_dict = { yaml_dict = {
"include": base_yaml_name, "include": base_yaml_name,
"group": f"mmlu_{args.task_prefix}_{category}" "tag": f"mmlu_{args.task_prefix}_{category}"
if args.task_prefix != "" if args.task_prefix != ""
else f"mmlu_{category}", else f"mmlu_{category}",
"group_alias": category.replace("_", " "),
"task": f"mmlu_{args.task_prefix}_{subject}" "task": f"mmlu_{args.task_prefix}_{subject}"
if args.task_prefix != "" if args.task_prefix != ""
else f"mmlu_{subject}", else f"mmlu_{subject}",
......
...@@ -9,3 +9,5 @@ doc_to_choice: "{{choices}}" ...@@ -9,3 +9,5 @@ doc_to_choice: "{{choices}}"
doc_to_target: "{{answer}}" doc_to_target: "{{answer}}"
metadata: metadata:
version: 0.0 version: 0.0
dataset_kwargs:
trust_remote_code: true
group: mmlu_continuation group: mmlu_continuation
group_alias: mmlu (continuation)
task: task:
- mmlu_continuation_stem - group: stem
- mmlu_continuation_other task:
- mmlu_continuation_social_sciences - mmlu_continuation_stem
- mmlu_continuation_humanities aggregate_metric_list:
- metric: acc
weight_by_size: True
- group: other
task:
- mmlu_continuation_other
aggregate_metric_list:
- metric: acc
weight_by_size: True
- group: social sciences
task:
- mmlu_continuation_social_sciences
aggregate_metric_list:
- metric: acc
weight_by_size: True
- group: humanities
task:
- mmlu_continuation_humanities
aggregate_metric_list:
- metric: acc
weight_by_size: True
aggregate_metric_list:
- metric: acc
weight_by_size: True
metadata:
version: 1
"dataset_name": "abstract_algebra" "dataset_name": "abstract_algebra"
"description": "The following are questions (with answers) about abstract\ "description": "The following are questions (with answers) about abstract\
\ algebra.\n\n" \ algebra.\n\n"
"group": "mmlu_continuation_stem" "tag": "mmlu_continuation_stem"
"include": "_continuation_template_yaml" "include": "_continuation_template_yaml"
"task": "mmlu_continuation_abstract_algebra" "task": "mmlu_continuation_abstract_algebra"
"dataset_name": "anatomy" "dataset_name": "anatomy"
"description": "The following are questions (with answers) about anatomy.\n\ "description": "The following are questions (with answers) about anatomy.\n\
\n" \n"
"group": "mmlu_continuation_stem" "tag": "mmlu_continuation_stem"
"include": "_continuation_template_yaml" "include": "_continuation_template_yaml"
"task": "mmlu_continuation_anatomy" "task": "mmlu_continuation_anatomy"
"dataset_name": "astronomy" "dataset_name": "astronomy"
"description": "The following are questions (with answers) about astronomy.\n\ "description": "The following are questions (with answers) about astronomy.\n\
\n" \n"
"group": "mmlu_continuation_stem" "tag": "mmlu_continuation_stem"
"include": "_continuation_template_yaml" "include": "_continuation_template_yaml"
"task": "mmlu_continuation_astronomy" "task": "mmlu_continuation_astronomy"
"dataset_name": "business_ethics" "dataset_name": "business_ethics"
"description": "The following are questions (with answers) about business\ "description": "The following are questions (with answers) about business\
\ ethics.\n\n" \ ethics.\n\n"
"group": "mmlu_continuation_other" "tag": "mmlu_continuation_other"
"include": "_continuation_template_yaml" "include": "_continuation_template_yaml"
"task": "mmlu_continuation_business_ethics" "task": "mmlu_continuation_business_ethics"
"dataset_name": "clinical_knowledge" "dataset_name": "clinical_knowledge"
"description": "The following are questions (with answers) about clinical\ "description": "The following are questions (with answers) about clinical\
\ knowledge.\n\n" \ knowledge.\n\n"
"group": "mmlu_continuation_other" "tag": "mmlu_continuation_other"
"include": "_continuation_template_yaml" "include": "_continuation_template_yaml"
"task": "mmlu_continuation_clinical_knowledge" "task": "mmlu_continuation_clinical_knowledge"
"dataset_name": "college_biology" "dataset_name": "college_biology"
"description": "The following are questions (with answers) about college\ "description": "The following are questions (with answers) about college\
\ biology.\n\n" \ biology.\n\n"
"group": "mmlu_continuation_stem" "tag": "mmlu_continuation_stem"
"include": "_continuation_template_yaml" "include": "_continuation_template_yaml"
"task": "mmlu_continuation_college_biology" "task": "mmlu_continuation_college_biology"
"dataset_name": "college_chemistry" "dataset_name": "college_chemistry"
"description": "The following are questions (with answers) about college\ "description": "The following are questions (with answers) about college\
\ chemistry.\n\n" \ chemistry.\n\n"
"group": "mmlu_continuation_stem" "tag": "mmlu_continuation_stem"
"include": "_continuation_template_yaml" "include": "_continuation_template_yaml"
"task": "mmlu_continuation_college_chemistry" "task": "mmlu_continuation_college_chemistry"
"dataset_name": "college_computer_science" "dataset_name": "college_computer_science"
"description": "The following are questions (with answers) about college\ "description": "The following are questions (with answers) about college\
\ computer science.\n\n" \ computer science.\n\n"
"group": "mmlu_continuation_stem" "tag": "mmlu_continuation_stem"
"include": "_continuation_template_yaml" "include": "_continuation_template_yaml"
"task": "mmlu_continuation_college_computer_science" "task": "mmlu_continuation_college_computer_science"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment