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
fb5aaf51
"vscode:/vscode.git/clone" did not exist on "a684cbb8543d2c25ddc7341420d68f8642124e3d"
Unverified
Commit
fb5aaf51
authored
Nov 23, 2020
by
Leo Gao
Committed by
GitHub
Nov 23, 2020
Browse files
Add --limit flag
parent
8d7d2132
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
main.py
main.py
+9
-1
No files found.
main.py
View file @
fb5aaf51
...
@@ -15,9 +15,17 @@ def parse_args():
...
@@ -15,9 +15,17 @@ def parse_args():
parser
.
add_argument
(
'--num_fewshot'
,
type
=
int
,
default
=
1
)
parser
.
add_argument
(
'--num_fewshot'
,
type
=
int
,
default
=
1
)
parser
.
add_argument
(
'--seed'
,
type
=
int
,
default
=
1234
)
parser
.
add_argument
(
'--seed'
,
type
=
int
,
default
=
1234
)
parser
.
add_argument
(
'--output_path'
,
default
=
None
)
parser
.
add_argument
(
'--output_path'
,
default
=
None
)
parser
.
add_argument
(
'--limit'
,
default
=
None
)
return
parser
.
parse_args
()
return
parser
.
parse_args
()
def
limit
(
it
,
lim
):
for
i
,
x
in
enumerate
(
it
):
if
i
>=
lim
:
break
yield
x
def
main
():
def
main
():
args
=
parse_args
()
args
=
parse_args
()
random
.
seed
(
args
.
seed
)
random
.
seed
(
args
.
seed
)
...
@@ -34,7 +42,7 @@ def main():
...
@@ -34,7 +42,7 @@ def main():
if
not
task
.
has_validation_docs
():
if
not
task
.
has_validation_docs
():
continue
continue
result
=
task
.
evaluate
(
result
=
task
.
evaluate
(
docs
=
task
.
validation_docs
(),
docs
=
limit
(
task
.
validation_docs
(),
args
.
limit
),
lm
=
lm
,
lm
=
lm
,
provide_description
=
args
.
provide_description
,
provide_description
=
args
.
provide_description
,
num_fewshot
=
args
.
num_fewshot
,
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