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
442ce51a
Commit
442ce51a
authored
Jul 04, 2025
by
Baber
Browse files
fix logging
parent
897ed70a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
14 deletions
+5
-14
lm_eval/__main__.py
lm_eval/__main__.py
+2
-0
lm_eval/_cli/run.py
lm_eval/_cli/run.py
+1
-0
lm_eval/config/evaluate_config.py
lm_eval/config/evaluate_config.py
+1
-2
lm_eval/utils.py
lm_eval/utils.py
+1
-12
No files found.
lm_eval/__main__.py
View file @
442ce51a
from
lm_eval._cli.eval
import
Eval
from
lm_eval._cli.eval
import
Eval
from
lm_eval.utils
import
setup_logging
def
cli_evaluate
()
->
None
:
def
cli_evaluate
()
->
None
:
"""Main CLI entry point with subcommand and legacy support."""
"""Main CLI entry point with subcommand and legacy support."""
setup_logging
()
parser
=
Eval
()
parser
=
Eval
()
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
parser
.
execute
(
args
)
parser
.
execute
(
args
)
...
...
lm_eval/_cli/run.py
View file @
442ce51a
...
@@ -434,6 +434,7 @@ class Run(SubCommand):
...
@@ -434,6 +434,7 @@ class Run(SubCommand):
evaluation_tracker
.
recreate_metadata_card
()
evaluation_tracker
.
recreate_metadata_card
()
# Print results
# Print results
cfg
.
model_args
.
pop
(
"trust_remote_code"
,
None
)
print
(
print
(
f
"
{
cfg
.
model
}
(
{
cfg
.
model_args
}
), gen_kwargs: (
{
cfg
.
gen_kwargs
}
), "
f
"
{
cfg
.
model
}
(
{
cfg
.
model_args
}
), gen_kwargs: (
{
cfg
.
gen_kwargs
}
), "
f
"limit:
{
cfg
.
limit
}
, num_fewshot:
{
cfg
.
num_fewshot
}
, "
f
"limit:
{
cfg
.
limit
}
, num_fewshot:
{
cfg
.
num_fewshot
}
, "
...
...
lm_eval/config/evaluate_config.py
View file @
442ce51a
import
json
import
json
import
logging
import
logging
import
warnings
from
argparse
import
Namespace
from
argparse
import
Namespace
from
dataclasses
import
asdict
,
dataclass
,
field
from
dataclasses
import
asdict
,
dataclass
,
field
from
pathlib
import
Path
from
pathlib
import
Path
...
@@ -274,7 +273,7 @@ class EvaluatorConfig:
...
@@ -274,7 +273,7 @@ class EvaluatorConfig:
def
_validate_arguments
(
self
)
->
None
:
def
_validate_arguments
(
self
)
->
None
:
"""Validate configuration arguments and cross-field constraints."""
"""Validate configuration arguments and cross-field constraints."""
if
self
.
limit
:
if
self
.
limit
:
warn
ing
s
.
warn
(
logg
ing
.
warn
ing
(
"--limit SHOULD ONLY BE USED FOR TESTING. "
"--limit SHOULD ONLY BE USED FOR TESTING. "
"REAL METRICS SHOULD NOT BE COMPUTED USING LIMIT."
"REAL METRICS SHOULD NOT BE COMPUTED USING LIMIT."
)
)
...
...
lm_eval/utils.py
View file @
442ce51a
import
argparse
import
collections
import
collections
import
fnmatch
import
fnmatch
import
functools
import
functools
...
@@ -12,7 +11,7 @@ import re
...
@@ -12,7 +11,7 @@ import re
from
dataclasses
import
asdict
,
is_dataclass
from
dataclasses
import
asdict
,
is_dataclass
from
itertools
import
islice
from
itertools
import
islice
from
pathlib
import
Path
from
pathlib
import
Path
from
typing
import
Any
,
Callable
,
Dict
,
Generator
,
List
,
Optional
,
Tuple
from
typing
import
Any
,
Callable
,
Generator
,
List
,
Optional
,
Tuple
import
numpy
as
np
import
numpy
as
np
import
yaml
import
yaml
...
@@ -148,16 +147,6 @@ def simple_parse_args_string(args_string: Optional[str]) -> dict:
...
@@ -148,16 +147,6 @@ def simple_parse_args_string(args_string: Optional[str]) -> dict:
return
args_dict
return
args_dict
def
request_caching_arg_to_dict
(
cache_requests
:
str
)
->
dict
:
request_caching_args
=
{
"cache_requests"
:
cache_requests
in
{
"true"
,
"refresh"
},
"rewrite_requests_cache"
:
cache_requests
==
"refresh"
,
"delete_requests_cache"
:
cache_requests
==
"delete"
,
}
return
request_caching_args
def
join_iters
(
iters
):
def
join_iters
(
iters
):
for
iter
in
iters
:
for
iter
in
iters
:
yield
from
iter
yield
from
iter
...
...
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