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
9291edaa
Commit
9291edaa
authored
Oct 24, 2020
by
Charles Foster
Browse files
Updates to natural questions to deal with memory issues.
parent
0dda9f63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
lm_eval/tasks/naturalqs.py
lm_eval/tasks/naturalqs.py
+7
-0
No files found.
lm_eval/tasks/naturalqs.py
View file @
9291edaa
...
...
@@ -17,6 +17,13 @@ class NaturalQs(HFTask):
# TODO: figure out description
return
""
def
training_docs
(
self
):
# Cache training for faster few-shot.
# Data is too large to fit in memory.
self
.
data
[
"train"
])
return
self
.
data
[
"train"
])
def
doc_to_text
(
self
,
doc
,
include_target
=
True
):
question
=
doc
[
'question'
][
'text'
]
short_answer
=
doc
[
'annotations'
][
'short_answers'
][
0
][
'text'
]
...
...
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