Unverified Commit 12f2c5ea authored by GUIJIN SON's avatar GUIJIN SON Committed by GitHub
Browse files

Error in --num_fewshot option for K-MMLU Evaluation Harness (#1178)

* update kmmlu default formatting

* Update _default_kmmlu_yaml

* Delete lm_eval/tasks/kmmlu/utils.py
parent 65b8761d
...@@ -6,10 +6,9 @@ validation_split: dev ...@@ -6,10 +6,9 @@ validation_split: dev
test_split: test test_split: test
fewshot_split: dev fewshot_split: dev
output_type: multiple_choice output_type: multiple_choice
process_docs: !function utils.process_docs doc_to_text: "{{question.strip()}}\nA. {{A}}\nB. {{B}}\nC. {{C}}\nD. {{D}}\n정답:"
doc_to_text: "{{question}}" doc_to_choice: ["A", "B", "C", "D"]
doc_to_choice: "{{choices}}" doc_to_target: "{{['A', 'B', 'C', 'D'][answer-1]}}"
doc_to_target: "{{gold}}"
metric_list: metric_list:
- metric: acc - metric: acc
aggregation: mean aggregation: mean
...@@ -18,4 +17,4 @@ metric_list: ...@@ -18,4 +17,4 @@ metric_list:
aggregation: mean aggregation: mean
higher_is_better: true higher_is_better: true
metadata: metadata:
version: 1.0 version: 1.1
import datasets
def process_docs(dataset: datasets.Dataset) -> datasets.Dataset:
def _process_doc(doc):
instruction = (
f"다음을 읽고 정답으로 알맞은 것을 고르시요.\n"
f"### Question: {doc['question']}\n"
f"### Options:\n"
f"(1) {doc['A']}\n(2) {doc['B']}\n(3) {doc['C']}\n(4) {doc['D']}\n"
f"### Answer: 주어진 문제의 정답은"
)
out_doc = {
"question": instruction,
"choices": ["(1)", "(2)", "(3)", "(4)"],
"gold": int(doc["answer"]) - 1,
}
return out_doc
return dataset.map(_process_doc)
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