Files
stt-server/setup-venv.sh
mikael-lovqvists-claude-agent 18404708e3 Add WebSocket broadcast to stt-server.py
Every connection receives the full event stream (vad_start, vad_end,
transcript, error) from the moment it connects — no subscription
handshake required. The asyncio WebSocket server runs in a daemon thread
alongside the VAD loop and transcription thread. Events still go to
stdout unchanged.

Port is configurable via STT_PORT env var (default: 11501).
Add websockets to both setup scripts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 08:53:54 +00:00

32 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# setup-venv.sh — installs faster-whisper from PyPI into a venv.
#
# USE THIS SCRIPT when the PyPI ctranslate2 wheel matches your CUDA version.
# PyPI wheels target a specific CUDA major version; if your system matches,
# this is the fastest way to get started — no compilation required.
#
# If you see errors like "libcublas.so.12: cannot open shared object file" at
# runtime, your CUDA version does not match the wheel. Use setup-venv-local-build.sh
# instead, which compiles ctranslate2 against your actual CUDA installation.
#
# Environment overrides:
# PYTHON_ENV path to venv (default: ./venv)
#
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
VENV="${PYTHON_ENV:-${SCRIPT_DIR}/venv}"
if [ ! -d "${VENV}" ]; then
echo "==> creating venv at ${VENV}"
python3 -m venv "${VENV}"
fi
echo "==> installing torch and faster-whisper"
"${VENV}/bin/pip" install --upgrade pip --quiet
"${VENV}/bin/pip" install torch faster-whisper silero-vad websockets
echo ""
echo "==> done. Venv ready at ${VENV}"