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
b1019d2a
"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "bb03a14eddd455c6831475aeac2a7bf05c3d56e4"
Unverified
Commit
b1019d2a
authored
Jul 23, 2019
by
Yiqing-Zhou
Committed by
GitHub
Jul 23, 2019
Browse files
token[-1] -> token.rstrip('\n')
parent
bef0c629
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
pytorch_transformers/tokenization_bert.py
pytorch_transformers/tokenization_bert.py
+1
-1
No files found.
pytorch_transformers/tokenization_bert.py
View file @
b1019d2a
...
@@ -69,7 +69,7 @@ def load_vocab(vocab_file):
...
@@ -69,7 +69,7 @@ def load_vocab(vocab_file):
with
open
(
vocab_file
,
"r"
,
encoding
=
"utf-8"
)
as
reader
:
with
open
(
vocab_file
,
"r"
,
encoding
=
"utf-8"
)
as
reader
:
tokens
=
reader
.
readlines
()
tokens
=
reader
.
readlines
()
for
index
,
token
in
enumerate
(
tokens
):
for
index
,
token
in
enumerate
(
tokens
):
token
=
token
[:
-
1
]
token
=
token
.
rstrip
(
'
\n
'
)
vocab
[
token
]
=
index
vocab
[
token
]
=
index
return
vocab
return
vocab
...
...
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