diff --git a/pytorch_transformers/tokenization_bert.py b/pytorch_transformers/tokenization_bert.py index f1e900caaf..1ca758eda5 100644 --- a/pytorch_transformers/tokenization_bert.py +++ b/pytorch_transformers/tokenization_bert.py @@ -67,10 +67,9 @@ def load_vocab(vocab_file): """Loads a vocabulary file into a dictionary.""" vocab = collections.OrderedDict() with open(vocab_file, "r", encoding="utf-8") as reader: - tokens = reader.read().splitlines() + tokens = reader.readlines() for index, token in enumerate(tokens): vocab[token] = index - index += 1 return vocab