facebookresearch / LASER

Language-Agnostic SEntence Representations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug Report: Issue when embedding in docker container

FavorMylikes opened this issue · comments

Issue

(env) root@7b8c194bd840:/app# $LASER/tasks/embed/embed.sh test.txt en
2023-07-25 10:53:40,954 | INFO | fairseq.tasks.text_to_speech | Please install tensorboardX: pip install tensorboardX
2023-07-25 10:53:41,329 | INFO | embed | spm_model: /app/models/laser2.spm
2023-07-25 10:53:41,329 | INFO | embed | spm_cvocab: /app/models/laser2.cvocab
2023-07-25 10:53:41,329 | INFO | embed | loading encoder: /app/models/laser2.pt
2023-07-25 10:53:41,948 | INFO | preprocess | SPM processing test.txt  
Traceback (most recent call last):
  File "/app/LASER/source/embed.py", line 630, in <module>
    sort_kind=args.sort_kind,
  File "/app/LASER/source/embed.py", line 541, in embed_sentences
    over_write=False,
  File "/app/LASER/source/lib/text_processing.py", line 144, in SPMApply
    run(["/bin/bash", "-o", "pipefail", "-c", command], check=True, capture_output=True)
  File "/opt/conda/envs/env/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'capture_output'

Key code

RUN conda create -n env python=3.6

run(["/bin/bash", "-o", "pipefail", "-c", command], check=True, capture_output=True)

Explanation

This parameter capture_output is added till Python 3.7, need a update for the Dockerfile

Reference

Python doc 3.7

@FavorMylikes The docker app has been updated in #251.
It should work properly now.