start.bat 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 in a new window...
  56. echo Starting bridge in a new window...
  57. echo.
  58. echo Both windows must stay open during the service.
  59. echo Close this window or both others to shut down.
  60. echo.
  61. :: Activate venv and launch WhisperLiveKit in its own window
  62. start "Whisper Transcription Server" cmd /k "call .venv\Scripts\activate.bat && set HF_TOKEN=%HF_TOKEN% && echo Starting WhisperLiveKit (%WHISPER_MODEL%)... && wlk --model %WHISPER_MODEL% --lan en"
  63. :: Brief pause so Whisper can begin loading before the bridge connects
  64. timeout /t 5 /nobreak >nul
  65. :: Activate venv and launch the bridge (headless audio pipeline)
  66. start "Transcription Bridge" cmd /k "call .venv\Scripts\activate.bat && echo Starting bridge... && python bridge\bridge.py"
  67. :: Activate venv and launch the speaker admin web server
  68. start "Speaker Admin" cmd /k "call .venv\Scripts\activate.bat && echo Starting speaker admin... && python bridge\admin.py"
  69. :: Wait for servers to be ready then open browser tabs
  70. echo Waiting for servers to start...
  71. timeout /t 12 /nobreak >nul
  72. start http://localhost:8000
  73. start http://localhost:8001
  74. echo.
  75. echo All three windows must stay open during the service.
  76. echo.
  77. echo http://localhost:8000 ^<-- Whisper web UI ^(verify transcription^)
  78. echo http://localhost:8001 ^<-- Speaker admin ^(manage names + recordings^)
  79. echo.
  80. pause