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
bef0c629
"vscode:/vscode.git/clone" did not exist on "3ec10e6c76362191b61260300fe1d6173a8dd7e1"
Unverified
Commit
bef0c629
authored
Jul 22, 2019
by
Yiqing-Zhou
Committed by
GitHub
Jul 22, 2019
Browse files
fix
Remove '\n' before adding token into vocab
parent
897d0841
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
pytorch_transformers/tokenization_bert.py
pytorch_transformers/tokenization_bert.py
+1
-0
No files found.
pytorch_transformers/tokenization_bert.py
View file @
bef0c629
...
...
@@ -69,6 +69,7 @@ def load_vocab(vocab_file):
with
open
(
vocab_file
,
"r"
,
encoding
=
"utf-8"
)
as
reader
:
tokens
=
reader
.
readlines
()
for
index
,
token
in
enumerate
(
tokens
):
token
=
token
[:
-
1
]
vocab
[
token
]
=
index
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