"parse.vcproj" did not exist on "2ffc7dc6ac9efedf3ff7a54ecaeda7471990a28b"
Commit b2bab740 authored by Jonathan Tow's avatar Jonathan Tow
Browse files

Restore proper prompt formatting

parent 806b022b
...@@ -60,10 +60,24 @@ class GeneralHendrycksTest(MultipleChoiceTask): ...@@ -60,10 +60,24 @@ class GeneralHendrycksTest(MultipleChoiceTask):
return True return True
def _convert_standard(self, doc): def _convert_standard(self, doc):
def format_example(doc, choices):
"""
Question: <prompt>
A. <choice1>
B. <choice2>
C. <choice3>
D. <choice4>
Answer:
"""
prompt = "Question: " + doc[0]
prompt += " ".join([f"\n{choices[j]}. {doc[j+1]}" for j in range(4)])
prompt += "\nAnswer:"
return prompt
choices = ['A', 'B', 'C', 'D']
return { return {
"query": "Question: " + doc[0] + "\nAnswer:", "query": format_example(doc, choices),
"choices": doc[1:5], "choices": doc[1:5],
"gold": ['A', 'B', 'C', 'D'].index(doc[5]) "gold": choices.index(doc[5])
} }
def _load_docs(self, filename): def _load_docs(self, filename):
......
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