1 Star 0 Fork 1

leetop/jetson-cloudnative-demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
run_trtis.sh 3.28 KB
一键复制 编辑 原始数据 按行查看 历史
suhash-gitlab 提交于 2020-05-12 14:31 . Correcting the NGC paths
#!/usr/bin/env bash
CONTAINER_IMAGE="nvcr.io/nvidia/jetson-voice:r32.4.2"
ASR_MODEL="quartz"
show_help() {
echo " "
echo "usage: Starts the Docker container and TensorRT Inference Server"
echo " "
echo " ./scripts/docker_run_trtis.sh --container=<DOCKER_IMAGE>"
echo " --asr-model=<quartz|jasper>"
echo " "
echo "args:"
echo " "
echo " --help Show this help text and quit"
echo " "
echo " -c, --container=<DOCKER_IMAGE> Specifies the name of the Docker container"
echo " image to use (default: 'jetson-voice')"
echo " "
echo " --asr-model=<quartz|jasper> Selects Automatic Speech Recognition model"
echo " valid options are: quartz | quartz-v1 | jasper"
echo " default value is: quartz"
echo " "
}
die() {
printf '\n%s\n' "$1"
show_help
exit 1
}
# parse arguments
while :; do
case $1 in
-h|-\?|--help)
show_help # Display a usage synopsis.
exit
;;
-c|--container) # Takes an option argument; ensure it has been specified.
if [ "$2" ]; then
CONTAINER_IMAGE=$2
shift
else
die 'ERROR: "--container" requires a non-empty option argument.'
fi
;;
--container=?*)
CONTAINER_IMAGE=${1#*=} # Delete everything up to "=" and assign the remainder.
;;
--container=) # Handle the case of an empty --image=
die 'ERROR: "--container" requires a non-empty option argument.'
;;
--asr-model) # Takes an option argument; ensure it has been specified.
if [ "$2" ]; then
ASR_MODEL=$2
shift
else
die 'ERROR: "--asr-model" requires a non-empty option argument.'
fi
;;
--asr-model=?*)
ASR_MODEL=${1#*=} # Delete everything up to "=" and assign the remainder.
;;
--asr-model=) # Handle the case of an empty --image=
die 'ERROR: "--asr-model" requires a non-empty option argument.'
;;
--) # End of all options.
shift
break
;;
-?*)
printf 'WARN: Unknown option (ignored): %s\n' "$1" >&2
;;
*) # Default case: No more options, so break out of the loop.
break
esac
shift
done
# validate ASR_MODEL
if [ "$ASR_MODEL" != "quartz" ] && [ "$ASR_MODEL" != "quartz-v1" ] && [ "$ASR_MODEL" != "jasper" ]; then
die "ERROR: invalid option for --asr-model=$ASR_MODEL (must be 'quartz', 'quartz-v1', or 'jasper')"
fi
echo "Container: $CONTAINER_IMAGE"
echo "ASR Model: $ASR_MODEL"
echo " "
sudo nvpmodel -m 2
sudo jetson_clocks
xhost +
# run the container
sudo xhost +si:localuser:root
sudo docker run -d --runtime nvidia -it --rm --network host -e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix/:/tmp/.X11-unix \
--device /dev/bus/usb --device /dev/snd \
$CONTAINER_IMAGE \
trtserver --model-control-mode=none --model-repository=models/repository/jasper-asr-streaming-vad/
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/leetopAI/jetson-cloudnative-demo.git
git@gitee.com:leetopAI/jetson-cloudnative-demo.git
leetopAI
jetson-cloudnative-demo
jetson-cloudnative-demo
master

搜索帮助