Skip to content

Commit 50b7a88

Browse files
committed
Force to read text file with utf-8
1 parent 7a8636d commit 50b7a88

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
/sqlova/**/*.pyc
2-
/wikisql/**/*.pyc
1+
sqlova/**/*.pyc
2+
wikisql/**/*.pyc
3+
sqlnet/__pycache__
4+
bert/__pycache__
35
.idea
46
*.swp

bert/tokenization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def load_vocab(vocab_file):
7070
"""Loads a vocabulary file into a dictionary."""
7171
vocab = collections.OrderedDict()
7272
index = 0
73-
with open(vocab_file, "r") as reader:
73+
with open(vocab_file, "r", encoding="utf-8") as reader:
7474
while True:
7575
token = convert_to_unicode(reader.readline())
7676
if not token:

0 commit comments

Comments
 (0)