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