Commit 691e0c0d authored by Konrad's avatar Konrad
Browse files

Adding a fewshot in a more readable way

parent 9bd948df
......@@ -61,8 +61,8 @@ class ContextSampler:
doc,
num_fewshot,
fewshot_as_multiturn: bool = False,
chat_history: list = [],
):
chat_history = []
# draw an extra fewshot sample if using same split as evaluating on
n_samples = (
num_fewshot + 1
......
......@@ -1043,8 +1043,10 @@ class ConfigurableTask(Task):
# if few-shot - append examples after the system prompt
if num_fewshot > 0:
if apply_chat_template:
labeled_examples = self.sampler.get_chat_context(
doc, num_fewshot, fewshot_as_multiturn, labeled_examples
labeled_examples.extend(
self.sampler.get_chat_context(
doc, num_fewshot, fewshot_as_multiturn
)
)
else:
labeled_examples += self.sampler.get_context(doc, num_fewshot)
......
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