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
3ab5a262
Unverified
Commit
3ab5a262
authored
Dec 18, 2023
by
Baber Abbasi
Committed by
GitHub
Dec 18, 2023
Browse files
Add shorthand flags (#1149)
parent
08fcf1fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
lm_eval/__main__.py
lm_eval/__main__.py
+12
-2
No files found.
lm_eval/__main__.py
View file @
3ab5a262
...
@@ -25,20 +25,23 @@ def _handle_non_serializable(o):
...
@@ -25,20 +25,23 @@ def _handle_non_serializable(o):
def
parse_eval_args
()
->
argparse
.
Namespace
:
def
parse_eval_args
()
->
argparse
.
Namespace
:
parser
=
argparse
.
ArgumentParser
(
formatter_class
=
argparse
.
RawTextHelpFormatter
)
parser
=
argparse
.
ArgumentParser
(
formatter_class
=
argparse
.
RawTextHelpFormatter
)
parser
.
add_argument
(
"--model"
,
default
=
"hf"
,
help
=
"Name of model e.g. `hf`"
)
parser
.
add_argument
(
"--model"
,
"-m"
,
default
=
"hf"
,
help
=
"Name of model e.g. `hf`"
)
parser
.
add_argument
(
parser
.
add_argument
(
"--tasks"
,
"--tasks"
,
"-t"
,
default
=
None
,
default
=
None
,
metavar
=
"task1,task2"
,
metavar
=
"task1,task2"
,
help
=
"To get full list of tasks, use the command lm-eval --tasks list"
,
help
=
"To get full list of tasks, use the command lm-eval --tasks list"
,
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--model_args"
,
"--model_args"
,
"-a"
,
default
=
""
,
default
=
""
,
help
=
"Comma separated string arguments for model, e.g. `pretrained=EleutherAI/pythia-160m,dtype=float32`"
,
help
=
"Comma separated string arguments for model, e.g. `pretrained=EleutherAI/pythia-160m,dtype=float32`"
,
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--num_fewshot"
,
"--num_fewshot"
,
"-f"
,
type
=
int
,
type
=
int
,
default
=
None
,
default
=
None
,
metavar
=
"N"
,
metavar
=
"N"
,
...
@@ -46,6 +49,7 @@ def parse_eval_args() -> argparse.Namespace:
...
@@ -46,6 +49,7 @@ def parse_eval_args() -> argparse.Namespace:
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--batch_size"
,
"--batch_size"
,
"-b"
,
type
=
str
,
type
=
str
,
default
=
1
,
default
=
1
,
metavar
=
"auto|auto:N|N"
,
metavar
=
"auto|auto:N|N"
,
...
@@ -66,6 +70,7 @@ def parse_eval_args() -> argparse.Namespace:
...
@@ -66,6 +70,7 @@ def parse_eval_args() -> argparse.Namespace:
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--output_path"
,
"--output_path"
,
"-o"
,
default
=
None
,
default
=
None
,
type
=
str
,
type
=
str
,
metavar
=
"DIR|DIR/file.json"
,
metavar
=
"DIR|DIR/file.json"
,
...
@@ -73,6 +78,7 @@ def parse_eval_args() -> argparse.Namespace:
...
@@ -73,6 +78,7 @@ def parse_eval_args() -> argparse.Namespace:
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--limit"
,
"--limit"
,
"-L"
,
type
=
float
,
type
=
float
,
default
=
None
,
default
=
None
,
metavar
=
"N|0<N<1"
,
metavar
=
"N|0<N<1"
,
...
@@ -81,6 +87,7 @@ def parse_eval_args() -> argparse.Namespace:
...
@@ -81,6 +87,7 @@ def parse_eval_args() -> argparse.Namespace:
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--use_cache"
,
"--use_cache"
,
"-c"
,
type
=
str
,
type
=
str
,
default
=
None
,
default
=
None
,
metavar
=
"DIR"
,
metavar
=
"DIR"
,
...
@@ -94,12 +101,14 @@ def parse_eval_args() -> argparse.Namespace:
...
@@ -94,12 +101,14 @@ def parse_eval_args() -> argparse.Namespace:
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--write_out"
,
"--write_out"
,
"-w"
,
action
=
"store_true"
,
action
=
"store_true"
,
default
=
False
,
default
=
False
,
help
=
"Prints the prompt for the first few documents."
,
help
=
"Prints the prompt for the first few documents."
,
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--log_samples"
,
"--log_samples"
,
"-s"
,
action
=
"store_true"
,
action
=
"store_true"
,
default
=
False
,
default
=
False
,
help
=
"If True, write out all model outputs and documents for per-sample measurement and post-hoc analysis. Use with --output_path."
,
help
=
"If True, write out all model outputs and documents for per-sample measurement and post-hoc analysis. Use with --output_path."
,
...
@@ -127,7 +136,8 @@ def parse_eval_args() -> argparse.Namespace:
...
@@ -127,7 +136,8 @@ def parse_eval_args() -> argparse.Namespace:
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--verbosity"
,
"--verbosity"
,
type
=
str
,
"-v"
,
type
=
str
.
upper
,
default
=
"INFO"
,
default
=
"INFO"
,
metavar
=
"CRITICAL|ERROR|WARNING|INFO|DEBUG"
,
metavar
=
"CRITICAL|ERROR|WARNING|INFO|DEBUG"
,
help
=
"Controls the reported logging error level. Set to DEBUG when testing + adding new task configurations for comprehensive log output."
,
help
=
"Controls the reported logging error level. Set to DEBUG when testing + adding new task configurations for comprehensive log output."
,
...
...
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