Commit 9a64e642 authored by lintangsutawika's avatar lintangsutawika
Browse files

reformat

parent 75137836
...@@ -204,15 +204,7 @@ class Task(abc.ABC): ...@@ -204,15 +204,7 @@ class Task(abc.ABC):
self._fewshot_docs = None self._fewshot_docs = None
self._instances = None self._instances = None
self._config = ( self._config = TaskConfig({**config}) if config else TaskConfig()
TaskConfig(
{
**config,
}
)
if config
else TaskConfig()
)
self._filters = [build_filter_ensemble("none", [["take_first", None]])] self._filters = [build_filter_ensemble("none", [["take_first", None]])]
......
...@@ -15,11 +15,11 @@ from lm_eval.api.registry import ( ...@@ -15,11 +15,11 @@ from lm_eval.api.registry import (
import logging import logging
eval_logger = logging.getLogger("lm-eval")
# import python tasks # import python tasks
from .squad import SQuAD2 from .squad import SQuAD2
from .scrolls import QuALITY, NarrativeQA, ContractNLI, GovReport, SummScreenFD, QMSum
eval_logger = logging.getLogger("lm-eval")
def register_configurable_task(config: Dict[str, str]) -> int: def register_configurable_task(config: Dict[str, str]) -> int:
......
...@@ -34,6 +34,7 @@ _CITATION = """ ...@@ -34,6 +34,7 @@ _CITATION = """
} }
""" """
def _squad_metric(predictions, references): def _squad_metric(predictions, references):
squad_metric = datasets.load_metric("squad_v2") squad_metric = datasets.load_metric("squad_v2")
return squad_metric.compute(predictions=predictions, references=references) return squad_metric.compute(predictions=predictions, references=references)
...@@ -125,7 +126,7 @@ class SQuAD2(Task): ...@@ -125,7 +126,7 @@ class SQuAD2(Task):
arguments=(ctx, " " + "unanswerable"), arguments=(ctx, " " + "unanswerable"),
idx=0, idx=0,
**kwargs **kwargs
) ),
] ]
def process_results(self, doc, results): def process_results(self, doc, results):
......
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