"...py_src/git@developer.sourcefind.cn:change/sglang.git" did not exist on "03464890e0e0d048ebc1aa407e5235d7338f6aff"
Unverified Commit c4bc6688 authored by Thomas Wolf's avatar Thomas Wolf Committed by GitHub
Browse files

Merge pull request #860 from Yiqing-Zhou/patch-1

read().splitlines() -> readlines()
parents ba52fe69 b1019d2a
......@@ -67,10 +67,10 @@ 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):
token = token.rstrip('\n')
vocab[token] = index
index += 1
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