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
29c1f228
Commit
29c1f228
authored
Apr 10, 2021
by
Leo Gao
Browse files
Fix typo
parent
ec16d81d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
19 deletions
+3
-19
lm_eval/tasks/common.py
lm_eval/tasks/common.py
+3
-3
lm_eval/tasks/piqa.py
lm_eval/tasks/piqa.py
+0
-16
No files found.
lm_eval/tasks/common.py
View file @
29c1f228
...
...
@@ -33,16 +33,16 @@ class HFTask(Task):
# If data is too large to fit in memory, override this method.
if
self
.
has_training_docs
():
if
self
.
_training_docs
is
None
:
self
.
_training_docs
=
list
(
map
(
self
.
_convert_standard
(
self
.
data
[
"train"
]))
self
.
_training_docs
=
list
(
map
(
self
.
_convert_standard
,
self
.
data
[
"train"
]))
return
self
.
_training_docs
def
validation_docs
(
self
):
if
self
.
has_validation_docs
():
return
map
(
self
.
_convert_standard
(
self
.
data
[
"validation"
])
return
map
(
self
.
_convert_standard
,
self
.
data
[
"validation"
])
def
test_docs
(
self
):
if
self
.
has_test_docs
():
return
map
(
self
.
_convert_standard
(
self
.
data
[
"test"
])
return
map
(
self
.
_convert_standard
,
self
.
data
[
"test"
])
def
yesno
(
x
):
...
...
lm_eval/tasks/piqa.py
View file @
29c1f228
...
...
@@ -29,21 +29,5 @@ class PiQA(HFTask, MultipleChoiceTask):
}
return
out_doc
def
_load_docs
(
self
,
docs
):
for
record
in
docs
:
yield
self
.
_convert_standard
(
record
)
def
training_docs
(
self
):
docs
=
super
().
training_docs
()
return
self
.
_load_docs
(
docs
)
def
validation_docs
(
self
):
docs
=
super
().
validation_docs
()
return
self
.
_load_docs
(
docs
)
def
test_docs
(
self
):
docs
=
super
().
test_docs
()
return
self
.
_load_docs
(
docs
)
def
doc_to_text
(
self
,
doc
):
return
"Question: "
+
doc
[
"goal"
]
+
"
\n
Answer:"
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