Skip to content

Commit

Permalink
Fixed bug in GloVe trainer
Browse files Browse the repository at this point in the history
Problem with file handles to subprocesses
  • Loading branch information
markgw committed Oct 30, 2020
1 parent 0814c84 commit ba0f86a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/python/pimlico/modules/embeddings/glove/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ def execute(self):
glove_cmd.extend(["-seed", str(opts["seed"])])
self.log.info(" Command: {}".format(" ".join(glove_cmd)))
try:
with io.open(cooccur_file, "rb") as input_f, io.open(cooccur_shuf_file, "wb") as output_f:
subprocess.check_call(glove_cmd, stdin=input_f, stdout=output_f)
subprocess.check_call(glove_cmd)
except subprocess.CalledProcessError as e:
raise_from(ModuleExecutionError("call to GloVe's glove command failed: {}".format(e)), e)
glove_output.file_written("vectors.txt")
Expand Down

0 comments on commit ba0f86a

Please sign in to comment.