File size: 704 Bytes
b1a665d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
#!/bin/bash
set -e
# Default environment variables
export MODEL_PATH=${MODEL_PATH:-"/repository"}
echo "Starting NeMo Skills inference endpoint..."
echo "Model path: $MODEL_PATH"
# Function to handle cleanup on exit
cleanup() {
echo "Cleaning up processes..."
kill $(jobs -p) 2>/dev/null || true
wait
}
trap cleanup EXIT
# Start the model server in the background
echo "Starting model server..."
ns start_server \
--model="$MODEL_PATH" \
--server_gpus=2 \
--server_type=vllm \
--with_sandbox &
# Start the HTTP endpoint
echo "Starting HTTP endpoint on port 80..."
python /usr/local/endpoint/server.py &
# Wait for both processes
echo "Both servers started. Waiting..."
wait
|