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
707f9e92
Unverified
Commit
707f9e92
authored
Dec 12, 2019
by
Thomas Wolf
Committed by
GitHub
Dec 12, 2019
Browse files
Merge pull request #2081 from pglock/patch-1
handle string with only whitespaces as empty
parents
137e20a8
21451ec6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
transformers/tokenization_utils.py
transformers/tokenization_utils.py
+1
-1
No files found.
transformers/tokenization_utils.py
View file @
707f9e92
...
@@ -669,7 +669,7 @@ class PreTrainedTokenizer(object):
...
@@ -669,7 +669,7 @@ class PreTrainedTokenizer(object):
return
result
return
result
def
split_on_tokens
(
tok_list
,
text
):
def
split_on_tokens
(
tok_list
,
text
):
if
not
text
:
if
not
text
.
strip
()
:
return
[]
return
[]
if
not
tok_list
:
if
not
tok_list
:
return
self
.
_tokenize
(
text
,
**
kwargs
)
return
self
.
_tokenize
(
text
,
**
kwargs
)
...
...
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