Files
bdi_podman_serverconf/containers/chatterbox/entrypoint.sh
T

21 строка
633 B
Bash
Исполняемый файл

#!/bin/bash
# Starts the FastAPI server; model weights download on first request into /app/models
set -e
# wait for GPU: torch.cuda.is_available() caches its first (possibly premature) result
if [ -e /dev/kfd ]; then
echo "ROCm device detected, waiting for GPU to become available..."
for i in $(seq 1 15); do
if python3 -c "import sys, torch; sys.exit(0 if torch.cuda.is_available() else 1)" 2>/dev/null; then
echo "GPU is available."
break
fi
sleep 1
done
fi
echo "=== Chatterbox Server ==="
echo
exec uvicorn server:app --host 0.0.0.0 --port 8000 --app-dir /app "$@"