Commit 9d0df41b authored by haileyschoelkopf's avatar haileyschoelkopf
Browse files

add fewshot_config field

parent 624fb207
......@@ -75,6 +75,7 @@ class TaskConfig(dict):
description: str = ""
target_delimiter: str = " "
fewshot_delimiter: str = "\n\n"
fewshot_config: dict = None
# runtime configuration options
num_fewshot: int = 0
# scoring options
......@@ -629,9 +630,9 @@ class ConfigurableTask(Task):
self.prompt = None
if self.fewshot_docs() is not None:
self.sampler = samplers.Sampler(
list(self.fewshot_docs()), self, rnd=random.Random(1234)
)
self.sampler = samplers.get_sampler(
self.config.fewshot_config.get("sampler", "default")
)(list(self.fewshot_docs()), self, rnd=random.Random(1234))
if self.has_test_docs():
self.task_docs = self.test_docs()
......
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