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
fbd34827
"vscode:/vscode.git/clone" did not exist on "96e853f34c5b6b3ac9be55215f4cb61ea9341ef8"
Commit
fbd34827
authored
Jul 10, 2025
by
Baber
Browse files
fix tests
parent
cd30267a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
lm_eval/api/task.py
lm_eval/api/task.py
+1
-1
lm_eval/config/task.py
lm_eval/config/task.py
+1
-1
tests/test_tasks.py
tests/test_tasks.py
+8
-4
No files found.
lm_eval/api/task.py
View file @
fbd34827
...
...
@@ -1215,7 +1215,7 @@ class ConfigurableTask(Task):
arguments
=
[(
ctx
,
f
"
{
target_delimiter
}{
cont
}
"
)
for
cont
in
choices
]
# TODO: we should raise a warning telling users this will at most ~2x runtime.
if
"acc_mutual_info"
in
[
m
.
metric_name
for
m
in
self
.
metric_list
]:
if
"acc_mutual_info"
in
[
m
.
metric_name
for
m
in
self
.
config
.
_
metric_list
]:
# if we are calculating multiple choice accuracy
# using mutual information instead of raw loglikelihood as metric, need unconditional lls.
...
...
lm_eval/config/task.py
View file @
fbd34827
...
...
@@ -120,7 +120,7 @@ class FewshotConfig:
@
dataclass
class
TaskConfig
(
dict
):
# task naming/registry
task
:
str
task
:
Optional
[
str
]
=
None
task_alias
:
Optional
[
str
]
=
None
tag
:
Optional
[
Union
[
str
,
list
]]
=
None
# HF dataset options.
...
...
tests/test_tasks.py
View file @
fbd34827
...
...
@@ -46,8 +46,12 @@ def limit() -> int:
return
10
# Tests
class
BaseTasks
:
@
pytest
.
mark
.
parametrize
(
"task_class"
,
task_class
(
get_new_tasks_else_default
()),
ids
=
lambda
x
:
f
"
{
x
.
config
.
task
}
"
,
)
class
TestBaseTasks
:
"""
Base class for testing tasks
"""
...
...
@@ -161,7 +165,7 @@ class BaseTasks:
task_class
(
get_new_tasks_else_default
()),
ids
=
lambda
x
:
f
"
{
x
.
config
.
task
}
"
,
)
class
TestNewTasksElseDefault
(
BaseTasks
):
class
TestNewTasksElseDefault
(
Test
BaseTasks
):
"""
Test class parameterized with a list of new/modified tasks
(or a set of default tasks if none have been modified)
...
...
@@ -175,7 +179,7 @@ class TestNewTasksElseDefault(BaseTasks):
),
ids
=
lambda
x
:
f
"
{
x
.
config
.
task
}
"
,
)
class
TestUnitxtTasks
(
BaseTasks
):
class
TestUnitxtTasks
(
Test
BaseTasks
):
"""
Test class for Unitxt tasks parameterized with a small custom
task as described here:
...
...
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