Unverified Commit a35eb973 authored by Slim Frikha's avatar Slim Frikha Committed by GitHub
Browse files

feat(scrolls): delete chat_template from kwargs (#3267)

parent 5ac7cdf8
......@@ -256,8 +256,9 @@ class _SCROLLSMultipleChoiceTask(_SCROLLSTask):
"em": acc_norm * 100.0,
}
def construct_requests(self, doc, ctx, **kwargs):
apply_chat_template = kwargs.pop("apply_chat_template", False)
def construct_requests(
self, doc, ctx, chat_template=None, apply_chat_template=False, **kwargs
):
request_list = [
Instance(
request_type="loglikelihood",
......@@ -291,8 +292,9 @@ class _SCROLLSSummaryTask(_SCROLLSTask):
"rougeL": (results[0], doc["outputs"]),
}
def construct_requests(self, doc, ctx, **kwargs):
kwargs.pop("apply_chat_template", False)
def construct_requests(
self, doc, ctx, chat_template=None, apply_chat_template=False, **kwargs
):
return Instance(
request_type="generate_until",
doc=doc,
......@@ -334,8 +336,9 @@ class Qasper(_SCROLLSTask):
prediction = results[0]
return {"f1": (prediction, doc["outputs"])}
def construct_requests(self, doc, ctx, **kwargs):
apply_chat_template = kwargs.pop("apply_chat_template", False)
def construct_requests(
self, doc, ctx, chat_template=None, apply_chat_template=False, **kwargs
):
if doc["is_yes_no"]:
return [
Instance(
......@@ -416,8 +419,9 @@ class NarrativeQA(_SCROLLSTask):
def process_results(self, doc, results):
return {"f1": (results[0], doc["outputs"])}
def construct_requests(self, doc, ctx, **kwargs):
kwargs.pop("apply_chat_template", False)
def construct_requests(
self, doc, ctx, chat_template=None, apply_chat_template=False, **kwargs
):
return Instance(
request_type="generate_until",
doc=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