Commit 95908d8b authored by h-albert-lee's avatar h-albert-lee
Browse files

Modify code for flake8

parent 9221cb57
import datasets import datasets
def process_docs(dataset: datasets.Dataset) -> datasets.Dataset: def process_docs(dataset: datasets.Dataset) -> datasets.Dataset:
def _process_doc(doc): def _process_doc(doc):
instruction = ( instruction = (
...@@ -12,9 +13,8 @@ def process_docs(dataset: datasets.Dataset) -> datasets.Dataset: ...@@ -12,9 +13,8 @@ def process_docs(dataset: datasets.Dataset) -> datasets.Dataset:
out_doc = { out_doc = {
"question": instruction, "question": instruction,
"choices": ["(1)", "(2)", "(3)", "(4)"], "choices": ["(1)", "(2)", "(3)", "(4)"],
"gold": int(doc["gold"]) - 1, "gold": int(doc["gold"]) - 1
} }
return out_doc return out_doc
return dataset.map(_process_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