start.bat 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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% --language en --backend faster-whisper --diarization-backend diart"
  67. start "Whisper Transcription Server" cmd /k "call .venv\Scripts\activate.bat && set HF_TOKEN=%HF_TOKEN% && set IMAGEIO_FFMPEG_EXE=.venv\Lib\site-packages\imageio_ffmpeg\binaries\ffmpeg-win-x86_64-v7.1.exe && wlk --model %WHISPER_MODEL% --language en --backend faster-whisper --diarization-backend diart"
  68. :: Give Whisper more time on first run — diarization model downloads ~500 MB
  69. timeout /t 15 /nobreak >nul
  70. :: Activate venv and launch the bridge (headless audio pipeline)
  71. start "Transcription Bridge" cmd /k "call .venv\Scripts\activate.bat && echo Starting bridge... && python bridge\bridge.py"
  72. :: Activate venv and launch the speaker admin web server
  73. start "Speaker Admin" cmd /k "call .venv\Scripts\activate.bat && echo Starting speaker admin... && python bridge\admin.py"
  74. :: Wait for servers to be ready then open browser tabs
  75. echo Waiting for servers to start...
  76. timeout /t 12 /nobreak >nul
  77. start http://localhost:8000
  78. start http://localhost:8001
  79. echo.
  80. echo All three windows must stay open during the service.
  81. echo.
  82. echo http://localhost:8000 ^<-- Whisper web UI ^(verify transcription^)
  83. echo http://localhost:8001 ^<-- Speaker admin ^(manage names + recordings^)
  84. echo.
  85. pause