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
3b5e554f
Commit
3b5e554f
authored
Oct 04, 2023
by
haileyschoelkopf
Browse files
move to __main__.py
parent
6f92c20d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
lm_eval/__main__.py
lm_eval/__main__.py
+11
-7
No files found.
lm_eval/main.py
→
lm_eval/
__
main
__
.py
View file @
3b5e554f
...
...
@@ -12,10 +12,9 @@ from lm_eval.api.registry import ALL_TASKS
from
lm_eval.logger
import
eval_logger
,
SPACING
from
lm_eval.tasks
import
include_task_folder
os
.
environ
[
"TOKENIZERS_PARALLELISM"
]
=
"false"
from
typing
import
Union
def
parse_args
()
->
argparse
.
Namespace
:
def
parse_eval_args
()
->
argparse
.
Namespace
:
parser
=
argparse
.
ArgumentParser
(
formatter_class
=
argparse
.
RawTextHelpFormatter
)
parser
.
add_argument
(
"--model"
,
required
=
True
,
help
=
"Name of model e.g. `hf`"
)
parser
.
add_argument
(
...
...
@@ -100,8 +99,13 @@ def parse_args() -> argparse.Namespace:
return
parser
.
parse_args
()
def
main
()
->
None
:
args
=
parse_args
()
def
cli_evaluate
(
args
:
Union
[
argparse
.
Namespace
,
None
]
=
None
)
->
None
:
if
not
args
:
# we allow for args to be passed externally, else we parse them ourselves
args
=
parse_eval_args
()
os
.
environ
[
"TOKENIZERS_PARALLELISM"
]
=
"false"
if
args
.
limit
:
eval_logger
.
warning
(
...
...
@@ -212,5 +216,5 @@ def main() -> None:
print
(
evaluator
.
make_table
(
results
,
"groups"
))
if
__name__
==
"__main__"
:
main
()
if
__name__
==
"__main__"
:
cli_evaluate
()
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