Commit 3fe4b022 authored by Baber's avatar Baber
Browse files

fixup fewshots

parent 42478664
......@@ -675,9 +675,8 @@ class ConfigurableTask(Task):
self.config.fewshot_cfg.num_fewshot() > 0
and self.fewshot_docs() is not None
):
self.fewshot_rnd = random.Random()
self.sampler = self.config.fewshot_cfg.init_sampler(
list(self.fewshot_docs()), rnd=self.fewshot_rnd
list(self.fewshot_docs()), self, rnd=self.fewshot_rnd
)
self.task_docs = self.eval_docs
......
......@@ -114,15 +114,14 @@ class FewshotConfig:
if rnd is None:
raise ValueError(
"A `random.Random` generator argument must be provided to `rnd` of FewShotSampler!"
)
) from None
return self.get_sampler(
docs,
task,
rnd=rnd,
fewshot_indices=fewshot_indices
if fewshot_indices
else self.fewshot_indices,
)
) # type: ignore
@dataclass
......@@ -170,7 +169,8 @@ class TaskConfig:
should_decontaminate: bool = False
doc_to_decontamination_query: str | None = None
gen_prefix: str | None = None
multiple_input: bool = False
multiple_inputs: bool = False
multiple_targets: bool = False
metadata: dict = field(
default_factory=dict
) # by default, not used in the code. allows for users to pass arbitrary info to tasks
......
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