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
606b98f7
Commit
606b98f7
authored
Feb 25, 2022
by
Stephen Hogg
Browse files
Change function signature so package root is always found from utils.py
parent
4d8dde31
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
lm_eval/evaluator.py
lm_eval/evaluator.py
+1
-1
lm_eval/utils.py
lm_eval/utils.py
+2
-2
No files found.
lm_eval/evaluator.py
View file @
606b98f7
...
@@ -65,7 +65,7 @@ def simple_evaluate(model, model_args=None, tasks=[],
...
@@ -65,7 +65,7 @@ def simple_evaluate(model, model_args=None, tasks=[],
task_dict
=
lm_eval
.
tasks
.
get_task_dict
(
tasks
)
task_dict
=
lm_eval
.
tasks
.
get_task_dict
(
tasks
)
if
check_integrity
:
if
check_integrity
:
run_task_tests
(
start_path
=
pathlib
.
Path
(
__file__
),
task_list
=
tasks
)
run_task_tests
(
task_list
=
tasks
)
results
=
evaluate
(
results
=
evaluate
(
lm
=
lm
,
lm
=
lm
,
...
...
lm_eval/utils.py
View file @
606b98f7
...
@@ -177,11 +177,11 @@ def find_test_root(start_path: pathlib.Path) -> pathlib.Path:
...
@@ -177,11 +177,11 @@ def find_test_root(start_path: pathlib.Path) -> pathlib.Path:
f
"of
{
start_path
}
"
)
f
"of
{
start_path
}
"
)
@
positional_deprecated
@
positional_deprecated
def
run_task_tests
(
start_path
:
pathlib
.
Path
,
task_list
:
List
[
str
]):
def
run_task_tests
(
task_list
:
List
[
str
]):
"""
"""
Find the package root and run the tests for the given tasks
Find the package root and run the tests for the given tasks
"""
"""
package_root
=
find_test_root
(
start_path
=
start_path
)
package_root
=
find_test_root
(
start_path
=
pathlib
.
Path
(
__file__
)
)
task_string
=
' or '
.
join
(
task_list
)
task_string
=
' or '
.
join
(
task_list
)
args
=
[
f
'
{
package_root
}
/tests/test_version_stable.py'
,
f
'--rootdir=
{
package_root
}
'
,
'-k'
,
f
'
{
task_string
}
'
]
args
=
[
f
'
{
package_root
}
/tests/test_version_stable.py'
,
f
'--rootdir=
{
package_root
}
'
,
'-k'
,
f
'
{
task_string
}
'
]
sys
.
path
.
append
(
str
(
package_root
))
sys
.
path
.
append
(
str
(
package_root
))
...
...
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