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
2ab78325
Commit
2ab78325
authored
Dec 21, 2019
by
Aymeric Augustin
Browse files
Fix F821 flake8 warning (x47).
Ignore warnings related to Python 2, because it's going away soon.
parent
631be270
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
transformers/tokenization_xlnet.py
transformers/tokenization_xlnet.py
+1
-1
No files found.
transformers/tokenization_xlnet.py
View file @
2ab78325
...
...
@@ -156,7 +156,7 @@ class XLNetTokenizer(PreTrainedTokenizer):
"""
text
=
self
.
preprocess_text
(
text
)
# note(zhiliny): in some systems, sentencepiece only accepts str for py2
if
six
.
PY2
and
isinstance
(
text
,
unicode
):
if
six
.
PY2
and
isinstance
(
text
,
unicode
):
# noqa: F821
text
=
text
.
encode
(
"utf-8"
)
if
not
sample
:
...
...
Prev
1
2
Next
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