268954f722
This commit introduces a new standalone FastAPI service for the NVIDIA Canary ASR model. Key changes include: - A new `canary/` directory containing the service code. - `Dockerfile`: Defines the Docker image for the Canary service. - `docker-compose.yml`: Configures the Docker Compose setup for running the service. - `main.py`: Implements the FastAPI application, model loading, and inference logic. - `requirements.txt`: Lists the Python dependencies for the service. - `CHUNKING.md`: Documents the long-form audio handling strategy for Canary. - `README.md`: Provides an overview of the service, API, and deployment instructions. - `deploy.sh`: A script for deploying the service to a remote host. This service allows for independent evaluation and deployment of the Canary ASR model, separate from the existing `doctate-whisper` service. It utilizes a buffered inference approach for handling long audio files, as detailed in `CHUNKING.md`.
37 lines
976 B
Bash
Executable File
37 lines
976 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Deploy the canary service to a remote host via rsync + ssh.
|
|
# Usage: ./deploy.sh [host] (default: minerva.lan)
|
|
set -euo pipefail
|
|
|
|
HOST="${1:-minerva.lan}"
|
|
REMOTE_DIR="/opt/stacks/doctate-canary"
|
|
LOCAL_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
|
|
echo ">>> Syncing $LOCAL_DIR -> $HOST:$REMOTE_DIR"
|
|
rsync -av \
|
|
--exclude 'deploy.sh' \
|
|
--exclude 'models/' \
|
|
"$LOCAL_DIR/" "$HOST:$REMOTE_DIR/"
|
|
|
|
echo ">>> Rebuilding + restarting on $HOST"
|
|
ssh "$HOST" "cd $REMOTE_DIR && \
|
|
docker compose down && \
|
|
docker build -t doctate-canary . && \
|
|
docker compose up -d"
|
|
|
|
echo ">>> Waiting for /health (up to 10 min for first model download + warmup)"
|
|
for i in $(seq 1 120); do
|
|
if ssh "$HOST" "curl -sf http://localhost:9002/health" 2>/dev/null; then
|
|
echo
|
|
echo ">>> OK"
|
|
ssh "$HOST" "curl -s http://localhost:9002/info"
|
|
echo
|
|
exit 0
|
|
fi
|
|
sleep 5
|
|
done
|
|
|
|
echo ">>> TIMEOUT — last logs:"
|
|
ssh "$HOST" "docker logs doctate-canary --tail 60"
|
|
exit 1
|