Commit 32612dc6 authored by Albert Jiang's avatar Albert Jiang
Browse files

fix a bug with greedy eval

parent 3149b6ac
......@@ -383,7 +383,7 @@ class BaseLM(LM):
# multiple tokens or that span multiple tokens correctly
# TODO: extract to TokenizedLM?
return self.generate(requests)
return self.generate(requests)[0]
class Task(abc.ABC):
......
......@@ -118,13 +118,14 @@ class Math(Task):
def process_results(self, doc, results, description=""):
retval = 0
assert isinstance(description, str)
if description == "":
answer = self.get_pure_answer(results[0])
elif self.MAJORITY_VOTING in self.parse_description(description):
answer = self.majority_vote(results[0])
else:
raise AssertionError
print(answer)
if self.is_equiv(
answer, self.remove_boxed(self.last_boxed_only_string(doc["solution"]))
):
......
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