Files
Scriberr/scripts/dev_setup_asr_engine.sh
Rishikanth Chandrasekaran 947731ba73 cleanup
2026-01-31 13:40:21 -08:00

38 lines
1001 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
ENGINE_DIR="$ROOT_DIR/asr-engines/scriberr-asr-onnx"
echo "ASR engine dev setup"
if ! command -v uv >/dev/null 2>&1; then
echo "⚠️ 'uv' not found. Installing via official installer..."
curl -LsSf https://astral.sh/uv/install.sh | sh
if ! command -v uv >/dev/null 2>&1; then
echo "❌ 'uv' still not found. Add it to PATH and re-run."
exit 1
fi
echo "✅ 'uv' installed"
fi
if [ ! -d "$ENGINE_DIR" ]; then
echo "❌ Missing ASR engine directory: $ENGINE_DIR"
exit 1
fi
if [ -d "$ENGINE_DIR/.venv" ]; then
if ! "$ENGINE_DIR/.venv/bin/python3" -c "import sys" >/dev/null 2>&1; then
echo "⚠️ Detected broken .venv. Recreating..."
rm -rf "$ENGINE_DIR/.venv"
fi
fi
echo "Syncing ASR engine deps..."
cd "$ENGINE_DIR"
uv python install 3.11 >/dev/null 2>&1 || true
uv venv --python 3.11 >/dev/null 2>&1 || true
uv sync
echo "✅ ASR engine dev setup complete"