start.bat 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. @echo off
  2. setlocal enabledelayedexpansion
  3. title Church Transcription — Launcher
  4. :: ════════════════════════════════════════════════════════════════════════════
  5. :: CONFIGURATION — edit these lines before first use
  6. :: ════════════════════════════════════════════════════════════════════════════
  7. :: Your HuggingFace access token (required for speaker diarization)
  8. :: Get one at https://huggingface.co/settings/tokens
  9. set HF_TOKEN=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
  10. :: Whisper model to use:
  11. :: large-v3 — most accurate, needs ~6 GB VRAM, ~3 s latency
  12. :: distil-large-v3 — faster (~2 s latency), very slightly less accurate
  13. :: medium — fallback if VRAM is limited (~4 GB VRAM)
  14. set WHISPER_MODEL=large-v3
  15. :: ════════════════════════════════════════════════════════════════════════════
  16. :: Check the token has been set
  17. if "%HF_TOKEN%"==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 (
  18. echo.
  19. echo ERROR: HuggingFace token not configured.
  20. echo.
  21. echo Open start.bat in Notepad and replace PASTE_YOUR_TOKEN_HERE
  22. echo with your token from https://huggingface.co/settings/tokens
  23. echo.
  24. echo See SETUP.md Part 7 for full instructions.
  25. echo.
  26. pause
  27. exit /b 1
  28. )
  29. :: Check virtual environment exists
  30. if not exist .venv\Scripts\activate.bat (
  31. echo.
  32. echo ERROR: Virtual environment not found.
  33. echo Please run install.bat first.
  34. echo.
  35. pause
  36. exit /b 1
  37. )
  38. :: Check Mosquitto is running
  39. sc query mosquitto | find "RUNNING" >nul 2>&1
  40. if errorlevel 1 (
  41. echo Starting Mosquitto MQTT broker...
  42. net start mosquitto >nul 2>&1
  43. if errorlevel 1 (
  44. echo WARNING: Could not start Mosquitto. Is it installed?
  45. echo See SETUP.md Part 4.
  46. pause
  47. exit /b 1
  48. )
  49. )
  50. echo.
  51. echo ============================================================
  52. echo Church Live Transcription Display
  53. echo ============================================================
  54. echo.
  55. echo Starting Whisper server ^(with speaker diarization^)...
  56. echo Starting bridge in a new window...
  57. echo Starting speaker admin in a new window...
  58. echo.
  59. echo All three windows must stay open during the service.
  60. echo.
  61. echo NOTE: First run downloads diarization models ^(~500 MB^).
  62. echo Wait for "Server running" before speaking.
  63. echo.
  64. :: Activate venv and launch WhisperLiveKit via the compatibility launcher
  65. :: The launcher patches torchaudio for diart and makes ffmpeg available.
  66. start "Whisper Transcription Server" cmd /k "call .venv\Scripts\activate.bat && set HF_TOKEN=%HF_TOKEN% && echo Starting WhisperLiveKit (%WHISPER_MODEL%) with speaker diarization... && python bridge\whisper_launcher.py --model %WHISPER_MODEL% --lan en --diarization-backend diart"
  67. :: Give Whisper more time on first run — diarization model downloads ~500 MB
  68. timeout /t 15 /nobreak >nul
  69. :: Activate venv and launch the bridge (headless audio pipeline)
  70. start "Transcription Bridge" cmd /k "call .venv\Scripts\activate.bat && echo Starting bridge... && python bridge\bridge.py"
  71. :: Activate venv and launch the speaker admin web server
  72. start "Speaker Admin" cmd /k "call .venv\Scripts\activate.bat && echo Starting speaker admin... && python bridge\admin.py"
  73. :: Wait for servers to be ready then open browser tabs
  74. echo Waiting for servers to start...
  75. timeout /t 12 /nobreak >nul
  76. start http://localhost:8000
  77. start http://localhost:8001
  78. echo.
  79. echo All three windows must stay open during the service.
  80. echo.
  81. echo http://localhost:8000 ^<-- Whisper web UI ^(verify transcription^)
  82. echo http://localhost:8001 ^<-- Speaker admin ^(manage names + recordings^)
  83. echo.
  84. pause