Merge pull request #1583 from yogendrasoni/master (resolves #1582)

Add rstrip after reading line from  vec file #1582
This commit is contained in:
Ines Montani 2017-11-15 12:02:48 +00:00 committed by GitHub
commit 9177c7d7aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,7 @@ def main(vectors_loc, lang=None):
nr_row, nr_dim = header.split()
nlp.vocab.reset_vectors(width=int(nr_dim))
for line in file_:
line = line.decode('utf8')
line = line.rstrip().decode('utf8')
pieces = line.rsplit(' ', nr_dim)
word = pieces[0]
vector = numpy.asarray([float(v) for v in pieces[1:]], dtype='f')