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
159c1a93
Commit
159c1a93
authored
May 06, 2023
by
Benjamin Fattori
Browse files
limit for doc iterator
parent
a7d6cb2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
lm_eval/evaluator.py
lm_eval/evaluator.py
+1
-1
No files found.
lm_eval/evaluator.py
View file @
159c1a93
...
...
@@ -197,7 +197,7 @@ def evaluate(
# calculate values for each filter setup (TODO: make getting list of keys cleaner)
# TODO: make it possible to use a different metric per key
for
key
in
task
.
instances
[
0
].
filtered_resps
.
keys
():
doc_iterator
=
itertools
.
islice
(
enumerate
(
task
.
test_docs
()),
lm
.
rank
,
None
,
lm
.
world_size
)
if
task
.
has_test_docs
()
else
itertools
.
islice
(
enumerate
(
task
.
validation_docs
()),
lm
.
rank
,
None
,
lm
.
world_size
)
doc_iterator
=
itertools
.
islice
(
enumerate
(
task
.
test_docs
()),
lm
.
rank
,
limit
,
lm
.
world_size
)
if
task
.
has_test_docs
()
else
itertools
.
islice
(
enumerate
(
task
.
validation_docs
()),
lm
.
rank
,
limit
,
lm
.
world_size
)
for
doc_id
,
doc
in
doc_iterator
:
# subset instances to only this document id ; sort by idx
requests
=
list
(
filter
(
lambda
x
:
x
.
doc_id
==
doc_id
,
task
.
instances
))
...
...
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