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
52f270dc
Commit
52f270dc
authored
Aug 27, 2021
by
Leo Gao
Browse files
triviaqa OOM fix
parent
e4766cd7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
lm_eval/tasks/triviaqa.py
lm_eval/tasks/triviaqa.py
+3
-2
tests/test_tasks.py
tests/test_tasks.py
+2
-0
No files found.
lm_eval/tasks/triviaqa.py
View file @
52f270dc
import
os
import
json
import
jsonlines
from
lm_eval.base
import
Task
,
rf
from
..metrics
import
mean
from
..utils
import
sh
...
...
@@ -27,10 +28,10 @@ class TriviaQA(Task):
return
False
def
training_docs
(
self
):
return
map
(
json
.
loads
,
open
(
'data/triviaqa/unfiltered-web-train.jsonl'
)
)
return
jsonlines
.
open
(
'data/triviaqa/unfiltered-web-train.jsonl'
)
def
validation_docs
(
self
):
return
map
(
json
.
loads
,
open
(
'data/triviaqa/unfiltered-web-dev.jsonl'
)
)
return
jsonlines
.
open
(
'data/triviaqa/unfiltered-web-dev.jsonl'
)
def
test_docs
(
self
):
raise
NotImplementedError
()
...
...
tests/test_tasks.py
View file @
52f270dc
...
...
@@ -30,6 +30,8 @@ def test_basic_interface(taskname, Task):
task2
=
Task
()
limit
=
None
if
taskname
in
[
"triviaqa"
]:
limit
=
10000
if
task
.
has_validation_docs
():
arr
=
list
(
islice
(
task
.
validation_docs
(),
limit
))
arr2
=
list
(
islice
(
task2
.
validation_docs
(),
limit
))
...
...
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