Skip to content

Commit

Permalink
Write UTF-8 byte strings in tensorboard conversion (#1144)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmylk committed Feb 14, 2017
1 parent cebee95 commit 923c656
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gensim/scripts/word2vec2tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def word2vec2tensor(word2vec_model_path,tensor_filename, binary=False):
with open(outfiletsv, 'w+') as file_vector:
with open(outfiletsvmeta, 'w+') as file_metadata:
for word in model.index2word:
file_metadata.write(gensim.utils.to_unicode(word) + '\n')
file_metadata.write(gensim.utils.to_utf8(word) + gensim.utils.to_utf8('\n'))
vector_row = '\t'.join(map(str, model[word]))
file_vector.write(vector_row + '\n')

Expand Down

0 comments on commit 923c656

Please sign in to comment.