envbuilder.sh 1.74 KB
Newer Older
Nikhilesh Bhatnagar's avatar
Nikhilesh Bhatnagar committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#!/bin/bash
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
sh Miniforge3-Linux-x86_64.sh -b -p ${HOME}/conda
rm Miniforge3-Linux-x86_64.sh
source "${HOME}/conda/etc/profile.d/conda.sh"
source "${HOME}/conda/etc/profile.d/mamba.sh"
conda install -y conda-pack
export PYTHONNOUSERSITE=True
conda create -y --name tts python=3.11 --no-default-packages
conda activate tts
mamba install -c "nvidia/label/cuda-11.8.0" libcublas libcufft cuda-cudart -y
git clone --recursive https://github.com/espnet/espnet_onnx.git
cd espnet_onnx && git apply /patches/espnet_onnx.patch && python setup.py bdist_wheel && cd ..
pip install -U numpy pandas nltk indic-num2words g2p_en "espnet_onnx/dist/espnet_onnx-0.2.0-py3-none-any.whl"
conda deactivate
conda pack -n tts
conda activate tts
mkdir -p /model_repo/tts/1/corpora && wget --directory-prefix=/model_repo/tts/1/corpora "https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/packages/corpora/cmudict.zip" && unzip /model_repo/tts/1/corpora/cmudict.zip -d /model_repo/tts/1/corpora
mkdir -p /model_repo/tts/1/taggers && wget --directory-prefix=/model_repo/tts/1/taggers https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/packages/taggers/averaged_perceptron_tagger.zip && unzip /model_repo/tts/1/taggers/averaged_perceptron_tagger.zip -d /model_repo/tts/1/taggers
git clone https://github.com/triton-inference-server/python_backend -b r23.10
cd python_backend && mkdir build && cd build
cmake -DTRITON_ENABLE_GPU=ON -DTRITON_BACKEND_REPO_TAG=r23.10 -DTRITON_COMMON_REPO_TAG=r23.10 -DTRITON_CORE_REPO_TAG=r23.10 -DCMAKE_INSTALL_PREFIX:PATH=`pwd`/install ..
make -j$(nproc) triton-python-backend-stub && cd ../..
mv tts.tar.gz python_backend/build/triton_python_backend_stub /model_repo/tts