"examples/community/iadb.py" did not exist on "97e1e3ba76aa9391a63caf742b5f2395771582d4"
Commit 9a64e642 authored by lintangsutawika's avatar lintangsutawika
Browse files

reformat

parent 75137836
......@@ -204,15 +204,7 @@ class Task(abc.ABC):
self._fewshot_docs = None
self._instances = None
self._config = (
TaskConfig(
{
**config,
}
)
if config
else TaskConfig()
)
self._config = TaskConfig({**config}) if config else TaskConfig()
self._filters = [build_filter_ensemble("none", [["take_first", None]])]
......
......@@ -15,11 +15,11 @@ from lm_eval.api.registry import (
import logging
eval_logger = logging.getLogger("lm-eval")
# import python tasks
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:
......
......@@ -34,6 +34,7 @@ _CITATION = """
}
"""
def _squad_metric(predictions, references):
squad_metric = datasets.load_metric("squad_v2")
return squad_metric.compute(predictions=predictions, references=references)
......@@ -125,7 +126,7 @@ class SQuAD2(Task):
arguments=(ctx, " " + "unanswerable"),
idx=0,
**kwargs
)
),
]
def process_results(self, doc, results):
......@@ -138,7 +139,7 @@ class SQuAD2(Task):
:param results:
The results of the requests created in construct_requests.
"""
continuation, (logprob_unanswerable, _) = results
no_answer_probability = exp(logprob_unanswerable)
......@@ -234,4 +235,4 @@ class SQuAD2(Task):
"NoAns_f1": True, # The F-score of predicted tokens versus the gold answer
"best_exact": True, # Best exact match (with varying threshold)
"best_f1": True, # Best F1 (with varying threshold)
}
\ No newline at end of file
}
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