Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
lm-evaluation-harness
Commits
54ce0195
Commit
54ce0195
authored
Jan 16, 2023
by
Albert Jiang
Browse files
make math answer extraction more robust
parent
2fce67b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
lm_eval/tasks/hendrycks_math.py
lm_eval/tasks/hendrycks_math.py
+2
-1
No files found.
lm_eval/tasks/hendrycks_math.py
View file @
54ce0195
...
@@ -120,7 +120,8 @@ class Math(Task):
...
@@ -120,7 +120,8 @@ class Math(Task):
assert
isinstance
(
description
,
str
)
assert
isinstance
(
description
,
str
)
if
description
==
""
:
if
description
==
""
:
answer
=
self
.
get_pure_answer
(
results
[
0
])
last_box_content
=
self
.
last_boxed_only_string
(
results
[
0
])
answer
=
self
.
get_pure_answer
(
self
.
remove_boxed
(
last_box_content
))
if
last_box_content
is
not
None
else
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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment