Commit e1d5c849 authored by lintangsutawika's avatar lintangsutawika
Browse files

moved squad.py and format changes

parent 8bf55a20
......@@ -208,7 +208,6 @@ class Task(abc.ABC):
TaskConfig(
{
**config,
**{"dataset_path": DATASET_PATH, "dataset_name": DATASET_NAME},
}
)
if config
......@@ -217,7 +216,6 @@ class Task(abc.ABC):
self._filters = [build_filter_ensemble("none", [["take_first", None]])]
def download(self, data_dir=None, cache_dir=None, download_mode=None) -> None:
"""Downloads and returns the task dataset.
Override this method to download the dataset from a custom API.
......@@ -357,9 +355,7 @@ class Task(abc.ABC):
False
), f"Task dataset (path={self.DATASET_PATH}, name={self.DATASET_NAME}) must have valid or test docs!"
eval_logger.info(
f"Building contexts for task on rank {rank}..."
)
eval_logger.info(f"Building contexts for task on rank {rank}...")
instances = []
for doc_id, doc in utils.create_iterator(
......@@ -450,7 +446,12 @@ class Task(abc.ABC):
@utils.positional_deprecated
def fewshot_context(
self, doc, num_fewshot, provide_description=None, rnd=random.Random(1234), description=None
self,
doc,
num_fewshot,
provide_description=None,
rnd=random.Random(1234),
description=None,
):
"""Returns a fewshot context string that is made up of a prepended description
(if provided), the `num_fewshot` number of examples, and an appended prompt example.
......@@ -800,7 +801,6 @@ class ConfigurableTask(Task):
)
return super().fewshot_docs()
@utils.positional_deprecated
def fewshot_context(self, doc, num_fewshot):
"""Returns a fewshot context string that is made up of a prepended description
......@@ -834,7 +834,6 @@ class ConfigurableTask(Task):
else:
return labeled_examples + str(example)
def apply_filters(self):
if hasattr(self, "_filters"):
for f in self._filters:
......
......@@ -15,7 +15,7 @@ from lm_eval.api.registry import (
import logging
from .squad import SQuAD2
from .squadv2.squad import SQuAD2
eval_logger = logging.getLogger("lm-eval")
......
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