Skip to content

Commit

Permalink
Correcting fasttext invocation handling (piskvorky#2611)
Browse files Browse the repository at this point in the history
  • Loading branch information
lopusz committed Jan 8, 2020
1 parent 8c03bc5 commit 984ff2b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions gensim/test/test_fasttext.py
Original file line number Diff line number Diff line change
Expand Up @@ -1448,14 +1448,12 @@ def _conv_line_to_array(line):


def _read_wordvectors_using_fasttext(fasttext_fname, words):
cmd = FT_CMD + " print-word-vectors " + fasttext_fname
cmd = [FT_CMD, "print-word-vectors", fasttext_fname]
process = subprocess.Popen(
cmd, stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True)
stdout=subprocess.PIPE)
words_str = '\n'.join(words)
out, err = process.communicate(input=words_str.encode("utf-8"))
out, _ = process.communicate(input=words_str.encode("utf-8"))
return _parse_wordvectors(out.decode("utf-8"))


Expand Down

0 comments on commit 984ff2b

Please sign in to comment.