Skip to content

Commit

Permalink
karpnv/issues6690 (NVIDIA#6705)
Browse files Browse the repository at this point in the history
* add sudo

Signed-off-by: Nikolay Karpov <karpnv@gmail.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* RUN

Signed-off-by: Nikolay Karpov <karpnv@gmail.com>

---------

Signed-off-by: Nikolay Karpov <karpnv@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: hsiehjackson <c2hsieh@ucsd.edu>
  • Loading branch information
2 people authored and hsiehjackson committed Jun 2, 2023
1 parent c856936 commit b70dbf7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
12 changes: 8 additions & 4 deletions scripts/asr_language_modeling/ngram_lm/install_beamsearch_decoders.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ fi
KENLM_MAX_ORDER=10 # Maximum order of KenLM model, also specified in the setup_os2s_decoders.py

cd $NEMO_PATH
apt-get update && apt-get upgrade -y && apt-get install -y liblzma-dev && rm -rf /var/lib/apt/lists/* # needed for flashlight decoder

if [ $(id -u) -eq 0 ]; then
alias sudo=eval
fi

sudo apt-get update && apt-get upgrade -y && apt-get install -y liblzma-dev && rm -rf /var/lib/apt/lists/* # liblzma needed for flashlight decoder


git clone https://github.com/NVIDIA/OpenSeq2Seq
cd OpenSeq2Seq
Expand All @@ -31,14 +37,12 @@ cd ..
mv OpenSeq2Seq/decoders .
rm -rf OpenSeq2Seq
cd decoders
# patch setup code to support the recent distutils
sed -i 's/, distutils/, distutils\nimport distutils.ccompiler/g' setup.py

cp $NEMO_PATH/scripts/installers/setup_os2s_decoders.py ./setup.py
./setup.sh

# install Boost package for KenLM
wget https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.bz2 --no-check-certificate && tar --bzip2 -xf $NEMO_PATH/decoders/boost_1_80_0.tar.bz2 && cd boost_1_80_0 && ./bootstrap.sh && ./b2 --layout=tagged link=static,shared threading=multi,single install -j4 || echo FAILURE
wget https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.bz2 --no-check-certificate && tar --bzip2 -xf $NEMO_PATH/decoders/boost_1_80_0.tar.bz2 && cd boost_1_80_0 && ./bootstrap.sh && sudo ./b2 --layout=tagged link=static,shared threading=multi,single install -j4 || echo FAILURE
export BOOST_ROOT=$NEMO_PATH/decoders/boost_1_80_0

# install KenLM
Expand Down
4 changes: 2 additions & 2 deletions scripts/installers/Dockerfile.ngramtools
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

# How to use? Build it from NeMo root folder:
# 1. git clone https://github.com/NVIDIA/NeMo.git && cd NeMo
# 2. DOCKER_BUILDKIT=1 docker build -t nemo:23.01.1 -f ./scripts/installers/Dockerfile.ngramtools .
# 2. DOCKER_BUILDKIT=1 docker build -t nemo:23.03.1 -f ./scripts/installers/Dockerfile.ngramtools .

from nvcr.io/nvidia/nemo:23.01
from nvcr.io/nvidia/nemo:23.03

WORKDIR /workspace/nemo

Expand Down
1 change: 1 addition & 0 deletions scripts/installers/setup_os2s_decoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from __future__ import absolute_import, division, print_function

import argparse
import distutils.ccompiler
import glob
import multiprocessing.pool
import os
Expand Down

0 comments on commit b70dbf7

Please sign in to comment.