MODELS_URL=$1 QUANTIZATION=$2 wget -O models.zip $MODELS_URL --no-check-certificate unzip models.zip python3 -m venv ./ssmt_ct2 source ./ssmt_ct2/bin/activate pip install ctranslate2 "OpenNMT-py==1.2.0" cd models ct2-opennmt-py-converter --model_path 1.pt --output_dir ./1_ct2 ct2-opennmt-py-converter --model_path 2.pt --output_dir ./2_ct2 # ct2-opennmt-py-converter --model_path 3.pt --output_dir ./3_ct2 ct2-opennmt-py-converter --model_path 4.pt --output_dir ./4_ct2 ct2-opennmt-py-converter --model_path 6.pt --output_dir ./6_ct2 ct2-opennmt-py-converter --model_path 7.pt --output_dir ./7_ct2 ct2-opennmt-py-converter --model_path 8.pt --output_dir ./8_ct2 ct2-opennmt-py-converter --model_path 9.pt --output_dir ./9_ct2 cd .. mkdir ssmt_triton_repo cd ssmt_triton_repo cp -r ../triton_models/ssmt_pipeline . cp -r ../triton_models/ssmt_model_demuxer . cp -r ../triton_models/ssmt_tokenizer . cp -r ../models/*.src ssmt_tokenizer/1/bpe_src cp -r ../triton_models/ssmt_template_model_repo ssmt_1_ct2 cp -r ../models/1_ct2 ssmt_1_ct2/1/translator sed -i 's/model_name/ssmt_1_ct2/' ssmt_1_ct2/config.pbtxt cp -r ../triton_models/ssmt_template_model_repo ssmt_2_ct2 cp -r ../models/2_ct2 ssmt_2_ct2/1/translator sed -i 's/model_name/ssmt_2_ct2/' ssmt_2_ct2/config.pbtxt # cp -r ../triton_models/ssmt_template_model_repo ssmt_3_ct2 # cp -r ../models/3_ct2 ssmt_3_ct2/1/translator # sed -i 's/model_name/ssmt_3_ct2/' ssmt_3_ct2/config.pbtxt cp -r ../triton_models/ssmt_template_model_repo ssmt_4_ct2 cp -r ../models/4_ct2 ssmt_4_ct2/1/translator sed -i 's/model_name/ssmt_4_ct2/' ssmt_4_ct2/config.pbtxt cp -r ../triton_models/ssmt_template_model_repo ssmt_6_ct2 cp -r ../models/6_ct2 ssmt_6_ct2/1/translator sed -i 's/model_name/ssmt_6_ct2/' ssmt_6_ct2/config.pbtxt cp -r ../triton_models/ssmt_template_model_repo ssmt_7_ct2 cp -r ../models/7_ct2 ssmt_7_ct2/1/translator sed -i 's/model_name/ssmt_7_ct2/' ssmt_7_ct2/config.pbtxt cp -r ../triton_models/ssmt_template_model_repo ssmt_8_ct2 cp -r ../models/8_ct2 ssmt_8_ct2/1/translator sed -i 's/model_name/ssmt_8_ct2/' ssmt_8_ct2/config.pbtxt cp -r ../triton_models/ssmt_template_model_repo ssmt_9_ct2 cp -r ../models/9_ct2 ssmt_9_ct2/1/translator sed -i 's/model_name/ssmt_9_ct2/' ssmt_9_ct2/config.pbtxt cd .. source deactivate rm -rf ssmt_ct2 rm -f models.zip rm -rf models