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
chenpangpang
transformers
Commits
11492431
Unverified
Commit
11492431
authored
Nov 03, 2021
by
Nicolas Patry
Committed by
GitHub
Nov 03, 2021
Browse files
Fixing typo in error message. (#14226)
parent
2c8957fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
src/transformers/models/layoutlmv2/tokenization_layoutlmv2.py
...transformers/models/layoutlmv2/tokenization_layoutlmv2.py
+2
-2
src/transformers/models/layoutlmv2/tokenization_layoutlmv2_fast.py
...formers/models/layoutlmv2/tokenization_layoutlmv2_fast.py
+2
-2
No files found.
src/transformers/models/layoutlmv2/tokenization_layoutlmv2.py
View file @
11492431
...
...
@@ -431,14 +431,14 @@ class LayoutLMv2Tokenizer(PreTrainedTokenizer):
raise
ValueError
(
"text input must of type `str` (single example) or `List[str]` (batch of examples). "
)
if
not
isinstance
(
text_pair
,
(
list
,
tuple
)):
raise
ValueError
(
"
w
ords must of type `List[str]` (single pretokenized example), "
"
W
ords must
be
of type `List[str]` (single pretokenized example), "
"or `List[List[str]]` (batch of pretokenized examples)."
)
else
:
# in case only text is provided => must be words
if
not
isinstance
(
text
,
(
list
,
tuple
)):
raise
ValueError
(
"Words must of type `List[str]` (single pretokenized example), "
"Words must
be
of type `List[str]` (single pretokenized example), "
"or `List[List[str]]` (batch of pretokenized examples)."
)
...
...
src/transformers/models/layoutlmv2/tokenization_layoutlmv2_fast.py
View file @
11492431
...
...
@@ -235,14 +235,14 @@ class LayoutLMv2TokenizerFast(PreTrainedTokenizerFast):
raise
ValueError
(
"text input must of type `str` (single example) or `List[str]` (batch of examples). "
)
if
not
isinstance
(
text_pair
,
(
list
,
tuple
)):
raise
ValueError
(
"
w
ords must of type `List[str]` (single pretokenized example), "
"
W
ords must
be
of type `List[str]` (single pretokenized example), "
"or `List[List[str]]` (batch of pretokenized examples)."
)
else
:
# in case only text is provided => must be words
if
not
isinstance
(
text
,
(
list
,
tuple
)):
raise
ValueError
(
"Words must of type `List[str]` (single pretokenized example), "
"Words must
be
of type `List[str]` (single pretokenized example), "
"or `List[List[str]]` (batch of pretokenized examples)."
)
...
...
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