text-generation-inference/run.sh

30 lines
657 B
Bash
Raw Normal View History

2022-10-14 13:56:21 +00:00
#!/usr/bin/env bash
2022-10-17 12:59:00 +00:00
server_cmd="bloom-inference-server launcher $MODEL_NAME --num-gpus $NUM_GPUS --shard-directory $MODEL_BASE_PATH"
2022-10-14 13:56:21 +00:00
2022-10-17 12:59:00 +00:00
# Run in background
$server_cmd 2>&1 > /dev/null &
2022-10-14 13:56:21 +00:00
2022-10-17 12:59:00 +00:00
# Check if server is running by checking if the unix socket is created
FILE=/tmp/bloom-inference-0
2022-10-14 13:56:21 +00:00
while :
do
if test -S "$FILE"; then
echo "Text Generation Python gRPC server started"
break
else
echo "Waiting for Text Generation Python gRPC server to start"
sleep 5
fi
done
sleep 1
2022-10-17 12:59:00 +00:00
# Run in background
text-generation-router &
# Wait for any process to exit
wait -n
# Exit with status of process that exited first
exit $?