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
6824d39d
Unverified
Commit
6824d39d
authored
Dec 04, 2024
by
Baber Abbasi
Committed by
GitHub
Dec 04, 2024
Browse files
add better testing when both doc_to_text ends in and target_delimiter are whitespaces (#2535)
parent
4a12959f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
tests/test_tasks.py
tests/test_tasks.py
+8
-4
No files found.
tests/test_tasks.py
View file @
6824d39d
...
@@ -79,11 +79,15 @@ class TestNewTasks:
...
@@ -79,11 +79,15 @@ class TestNewTasks:
)
)
_array
=
[
task
.
doc_to_text
(
doc
)
for
doc
in
arr
]
_array
=
[
task
.
doc_to_text
(
doc
)
for
doc
in
arr
]
# space convention; allow txt to have length 0 for perplexity-like tasks since the model tacks an <|endoftext|> on
# space convention; allow txt to have length 0 for perplexity-like tasks since the model tacks an <|endoftext|> on
target_delimiter
:
str
=
task
.
config
.
target_delimiter
if
not
task
.
multiple_input
:
if
not
task
.
multiple_input
:
assert
all
(
for
x
in
_array
:
isinstance
(
x
,
str
)
and
(
x
[
-
1
]
!=
" "
if
len
(
x
)
!=
0
else
True
)
assert
isinstance
(
x
,
str
)
for
x
in
_array
assert
(
)
(
x
[
-
1
].
isspace
()
is
False
if
len
(
x
)
>
0
else
True
)
if
target_delimiter
.
isspace
()
else
True
),
"doc_to_text ends in a whitespace and target delimiter also a whitespace"
else
:
else
:
pass
pass
...
...
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