Unverified Commit cf6a8321 authored by Lintang Sutawika's avatar Lintang Sutawika Committed by GitHub
Browse files

fixed fewshot loading for multiple input tasks (#1255)

parent 28ec7fa9
...@@ -787,6 +787,9 @@ class ConfigurableTask(Task): ...@@ -787,6 +787,9 @@ class ConfigurableTask(Task):
) )
example = self.doc_to_text(doc) example = self.doc_to_text(doc)
if self.multiple_input:
return labeled_examples
else:
if isinstance(example, str): if isinstance(example, str):
return labeled_examples + example return labeled_examples + example
elif isinstance(example, list): elif isinstance(example, list):
...@@ -952,7 +955,9 @@ class ConfigurableTask(Task): ...@@ -952,7 +955,9 @@ class ConfigurableTask(Task):
if self.multiple_input: if self.multiple_input:
# If there are multiple inputs, choices are placed in the ctx # If there are multiple inputs, choices are placed in the ctx
cont = self.doc_to_target(doc) cont = self.doc_to_target(doc)
arguments = [(ctx, f"{target_delimiter}{cont}") for ctx in choices] arguments = [
(ctx + choice, f"{target_delimiter}{cont}") for choice in choices
]
else: else:
# Otherwise they are placed in the continuation # Otherwise they are placed in the continuation
arguments = [(ctx, f"{target_delimiter}{cont}") for cont in choices] arguments = [(ctx, f"{target_delimiter}{cont}") for cont in choices]
......
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