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
15c87e9b
Unverified
Commit
15c87e9b
authored
Nov 23, 2020
by
Stella Biderman
Committed by
GitHub
Nov 23, 2020
Browse files
Merge pull request #59 from EleutherAI/dev
Changing implementation of the —limit flag
parents
fb5aaf51
6c93185c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
main.py
main.py
+2
-9
No files found.
main.py
View file @
15c87e9b
...
...
@@ -2,6 +2,7 @@ import argparse
import
json
import
numpy
as
np
import
random
import
itertools
from
lm_eval
import
models
,
tasks
...
...
@@ -18,14 +19,6 @@ def parse_args():
parser
.
add_argument
(
'--limit'
,
default
=
None
)
return
parser
.
parse_args
()
def
limit
(
it
,
lim
):
for
i
,
x
in
enumerate
(
it
):
if
i
>=
lim
:
break
yield
x
def
main
():
args
=
parse_args
()
random
.
seed
(
args
.
seed
)
...
...
@@ -42,7 +35,7 @@ def main():
if
not
task
.
has_validation_docs
():
continue
result
=
task
.
evaluate
(
docs
=
limit
(
task
.
validation_docs
(),
args
.
limit
),
docs
=
itertools
.
isslice
(
task
.
validation_docs
(),
0
,
args
.
limit
),
lm
=
lm
,
provide_description
=
args
.
provide_description
,
num_fewshot
=
args
.
num_fewshot
,
...
...
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