"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "bb03a14eddd455c6831475aeac2a7bf05c3d56e4"
Unverified Commit b1019d2a authored by Yiqing-Zhou's avatar Yiqing-Zhou Committed by GitHub
Browse files

token[-1] -> token.rstrip('\n')

parent bef0c629
...@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment