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
df1fc6c3
"vscode:/vscode.git/clone" did not exist on "8b5c467cc52c5b783ddc53e0e541139192f567ab"
Commit
df1fc6c3
authored
Dec 26, 2021
by
thomasw21
Browse files
Fix multirc
parent
f16e8b5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
lm_eval/tasks/superglue.py
lm_eval/tasks/superglue.py
+3
-2
No files found.
lm_eval/tasks/superglue.py
View file @
df1fc6c3
...
@@ -228,7 +228,7 @@ class MultiRC(HFTask):
...
@@ -228,7 +228,7 @@ class MultiRC(HFTask):
@
staticmethod
@
staticmethod
def
format_answer
(
answer
,
label
):
def
format_answer
(
answer
,
label
):
label_str
=
"yes"
if
label
else
"no"
label_str
=
"yes"
if
label
else
"no"
return
f
"
{
label_str
}
,
{
answe
r
}
"
return
f
"
{
answer
}
\n
Is the answer correct?
{
label_st
r
}
"
def
construct_requests
(
self
,
doc
,
ctx
):
def
construct_requests
(
self
,
doc
,
ctx
):
true_choice
=
self
.
format_answer
(
answer
=
doc
[
"answer"
],
label
=
True
)
true_choice
=
self
.
format_answer
(
answer
=
doc
[
"answer"
],
label
=
True
)
...
@@ -240,7 +240,8 @@ class MultiRC(HFTask):
...
@@ -240,7 +240,8 @@ class MultiRC(HFTask):
return
ll_true_choice
,
ll_false_choice
return
ll_true_choice
,
ll_false_choice
def
process_results
(
self
,
doc
,
results
):
def
process_results
(
self
,
doc
,
results
):
pred
=
np
.
argmax
(
results
)
ll_true_choice
,
ll_false_choice
=
results
pred
=
ll_true_choice
>
ll_false_choice
return
{
return
{
"acc"
:
(
pred
,
doc
)
"acc"
:
(
pred
,
doc
)
}
}
...
...
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