"magic_pdf/vscode:/vscode.git/clone" did not exist on "32fd7f958c074adad40bcf3aa2ab57e8bde54c9f"
Commit 0966e7b6 authored by Leo Gao's avatar Leo Gao
Browse files

Move fewshot stuff back into the right block

parent 3b2d5f6c
...@@ -181,6 +181,9 @@ class Task(abc.ABC): ...@@ -181,6 +181,9 @@ class Task(abc.ABC):
raw_description = self.fewshot_description() raw_description = self.fewshot_description()
description = (raw_description + "\n===\n\n") if provide_description and raw_description else "" description = (raw_description + "\n===\n\n") if provide_description and raw_description else ""
if num_fewshot == 0:
labeled_examples = ""
else:
# for sets with no training docs, draw from other set *but ensure no overlap with current doc* # for sets with no training docs, draw from other set *but ensure no overlap with current doc*
if self.has_training_docs(): if self.has_training_docs():
fewshotex = self.fewshot_examples(k=num_fewshot, rnd=rnd) fewshotex = self.fewshot_examples(k=num_fewshot, rnd=rnd)
...@@ -193,9 +196,6 @@ class Task(abc.ABC): ...@@ -193,9 +196,6 @@ class Task(abc.ABC):
# get rid of the doc that's the one we're evaluating, if it's in the fewshot # get rid of the doc that's the one we're evaluating, if it's in the fewshot
fewshotex = [x for x in fewshotex if x != doc][:num_fewshot] fewshotex = [x for x in fewshotex if x != doc][:num_fewshot]
if num_fewshot == 0:
labeled_examples = ""
else:
labeled_examples = "\n\n".join( labeled_examples = "\n\n".join(
[self.doc_to_text(doc) + self.doc_to_target(doc) for doc in fewshotex] [self.doc_to_text(doc) + self.doc_to_target(doc) for doc in fewshotex]
) + "\n\n" ) + "\n\n"
......
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