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
893ef63f
Commit
893ef63f
authored
Jun 12, 2021
by
Leo Gao
Browse files
Test training docs too and don't cache downloads
parent
7cbd0bba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
.github/workflows/python-app.yml
.github/workflows/python-app.yml
+1
-2
tests/test_tasks.py
tests/test_tasks.py
+12
-0
No files found.
.github/workflows/python-app.yml
View file @
893ef63f
...
@@ -21,10 +21,9 @@ jobs:
...
@@ -21,10 +21,9 @@ jobs:
with
:
with
:
# A list of files, directories, and wildcard patterns to cache and restore
# A list of files, directories, and wildcard patterns to cache and restore
path
:
|
path
:
|
data
~/.cache
~/.cache
# An explicit key for restoring and saving the cache
# An explicit key for restoring and saving the cache
key
:
evaldata-cache-
2
key
:
evaldata-cache-
3
-
name
:
Set up Python
3.9
-
name
:
Set up Python
3.9
uses
:
actions/setup-python@v2
uses
:
actions/setup-python@v2
with
:
with
:
...
...
tests/test_tasks.py
View file @
893ef63f
...
@@ -28,6 +28,7 @@ def test_basic_interface(taskname, Task):
...
@@ -28,6 +28,7 @@ def test_basic_interface(taskname, Task):
# (don't test train because it's slow)
# (don't test train because it's slow)
task2
=
Task
()
task2
=
Task
()
limit
=
None
limit
=
None
if
task
.
has_validation_docs
():
if
task
.
has_validation_docs
():
arr
=
list
(
islice
(
task
.
validation_docs
(),
limit
))
arr
=
list
(
islice
(
task
.
validation_docs
(),
limit
))
...
@@ -51,6 +52,17 @@ def test_basic_interface(taskname, Task):
...
@@ -51,6 +52,17 @@ def test_basic_interface(taskname, Task):
assert
reqs
==
reqs2
assert
reqs
==
reqs2
if
taskname
.
has_training_docs
():
arr
=
list
(
islice
(
task
.
training_docs
(),
limit
))
arr2
=
list
(
islice
(
task2
.
training_docs
(),
limit
))
assert
arr
==
arr2
reqs
=
[
task
.
construct_requests
(
doc
,
task
.
doc_to_text
(
doc
))
for
doc
in
arr
]
reqs2
=
[
task2
.
construct_requests
(
doc
,
task2
.
doc_to_text
(
doc
))
for
doc
in
arr2
]
assert
reqs
==
reqs2
@
pytest
.
mark
.
parametrize
(
"taskname,Task"
,
tasks
.
TASK_REGISTRY
.
items
())
@
pytest
.
mark
.
parametrize
(
"taskname,Task"
,
tasks
.
TASK_REGISTRY
.
items
())
def
test_documents_and_requests
(
taskname
,
Task
):
def
test_documents_and_requests
(
taskname
,
Task
):
...
...
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