run.sh 657 Bytes
Newer Older
Olivier Dehaene's avatar
Olivier Dehaene committed
1
2
#!/usr/bin/env bash

Olivier Dehaene's avatar
Olivier Dehaene committed
3
server_cmd="bloom-inference-server launcher $MODEL_NAME --num-gpus $NUM_GPUS --shard-directory $MODEL_BASE_PATH"
Olivier Dehaene's avatar
Olivier Dehaene committed
4

Olivier Dehaene's avatar
Olivier Dehaene committed
5
6
# Run in background
$server_cmd 2>&1 > /dev/null &
Olivier Dehaene's avatar
Olivier Dehaene committed
7

Olivier Dehaene's avatar
Olivier Dehaene committed
8
9
# Check if server is running by checking if the unix socket is created
FILE=/tmp/bloom-inference-0
Olivier Dehaene's avatar
Olivier Dehaene committed
10
11
12
13
14
15
16
17
18
19
20
21
22
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

Olivier Dehaene's avatar
Olivier Dehaene committed
23
24
25
26
27
28
29
30
# Run in background
text-generation-router &

# Wait for any process to exit
wait -n

# Exit with status of process that exited first
exit $?