Skip to content

Commit

Permalink
Transparently decode file
Browse files Browse the repository at this point in the history
  • Loading branch information
c-w committed May 24, 2019
1 parent 94e8bb3 commit aff0578
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/server/utils.py
Expand Up @@ -244,11 +244,11 @@ class CoNLLParser(FileParser):
def parse(self, file):
words, tags = [], []
data = []
file = io.TextIOWrapper(file, encoding='utf-8')
for i, line in enumerate(file, start=1):
if len(data) >= settings.IMPORT_BATCH_SIZE:
yield data
data = []
line = line.decode('utf-8')
line = line.strip()
if line:
try:
Expand Down

0 comments on commit aff0578

Please sign in to comment.