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
9f345f33
Commit
9f345f33
authored
Jul 21, 2025
by
Baber
Browse files
nit
parent
e3fee7ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
lm_eval/api/task.py
lm_eval/api/task.py
+4
-5
No files found.
lm_eval/api/task.py
View file @
9f345f33
...
@@ -484,11 +484,13 @@ class Task(abc.ABC):
...
@@ -484,11 +484,13 @@ class Task(abc.ABC):
def
apply_filters
(
self
)
->
list
[
Instance
]
|
None
:
def
apply_filters
(
self
)
->
list
[
Instance
]
|
None
:
"""Iterates over FilterEnsembles and applies them to instances"""
"""Iterates over FilterEnsembles and applies them to instances"""
if
hasattr
(
self
,
"_filters"
):
if
hasattr
(
self
,
"_filters"
)
and
self
.
_instances
:
for
f
in
self
.
_filters
:
for
f
in
self
.
_filters
:
f
.
apply
(
self
.
_instances
)
f
.
apply
(
self
.
_instances
)
else
:
else
:
eval_logger
.
warning
(
"No filter defined, passing through instances"
)
eval_logger
.
warning
(
"No filter defined or no instances, passing through instances"
)
return
self
.
_instances
return
self
.
_instances
def
dump_config
(
self
)
->
dict
:
def
dump_config
(
self
)
->
dict
:
...
@@ -499,9 +501,6 @@ class Task(abc.ABC):
...
@@ -499,9 +501,6 @@ class Task(abc.ABC):
def
set_config
(
self
,
key
:
str
,
value
:
Any
,
update
:
bool
=
False
)
->
None
:
def
set_config
(
self
,
key
:
str
,
value
:
Any
,
update
:
bool
=
False
)
->
None
:
"""Set or update the configuration for a given key."""
"""Set or update the configuration for a given key."""
if
key
is
None
:
raise
ValueError
(
"Key must be provided."
)
if
update
:
if
update
:
current_value
=
getattr
(
self
.
_config
,
key
,
{})
current_value
=
getattr
(
self
.
_config
,
key
,
{})
if
not
isinstance
(
current_value
,
dict
):
if
not
isinstance
(
current_value
,
dict
):
...
...
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