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
5d431ba9
Commit
5d431ba9
authored
Jan 28, 2021
by
Jon Tow
Browse files
Update `doc_to_text` to show candidate fill-ins
parent
65c46d22
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
lm_eval/tasks/hellaswag.py
lm_eval/tasks/hellaswag.py
+4
-1
No files found.
lm_eval/tasks/hellaswag.py
View file @
5d431ba9
import
re
import
numpy
as
np
import
numpy
as
np
from
..base
import
rf
,
mean
from
..base
import
rf
,
mean
from
.
common
import
HFTask
from
.
common
import
HFTask
...
@@ -34,7 +35,9 @@ class HellaSwag(HFTask):
...
@@ -34,7 +35,9 @@ class HellaSwag(HFTask):
"plausibly completes the situation."
"plausibly completes the situation."
def
doc_to_text
(
self
,
doc
):
def
doc_to_text
(
self
,
doc
):
return
doc
[
'activity_label'
]
+
': '
+
doc
[
'ctx'
]
+
'
\n
'
text
=
doc
[
'activity_label'
]
+
': '
+
doc
[
'ctx'
]
+
'
\n
'
text
+=
''
.
join
([
ending
+
"
\n
"
for
ending
in
doc
[
'endings'
]])
return
text
+
"
\n
"
def
doc_to_target
(
self
,
doc
):
def
doc_to_target
(
self
,
doc
):
letter_answer
=
doc
[
'label'
]
letter_answer
=
doc
[
'label'
]
...
...
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