Live Subtitles is a local-first Gradio app for browser microphone captioning: speech is transcribed with faster-whisper, segmented after pauses, and translated with converted Opus-MT CTranslate2 models.
The app currently targets French/English live translation, with English/Spanish and French/Spanish available when the optional converted models are present.
src/app.py: Gradio UI and microphone streaming transport.src/session.py: per-session audio-to-caption pipeline.src/audio.py: audio shaping, VAD integration, and phrase grouping helpers.src/translate.py: CTranslate2 Opus-MT translation adapter.tests/: deterministic unit and smoke tests.hf_deploy/: Hugging Face deploy scripts, Space templates, and model-card files.mockup/andtmp/: design/prototype scratch space, not part of deploy.
Install and run through Pixi:
pixi run appThen open:
http://127.0.0.1:7860
Run tests:
pixi run -e test pytest testsConverted MT models are expected under:
models/opus-mt-<source>-<target>/
The required base directions are:
opus-mt-fr-enopus-mt-en-fr
Optional Spanish target directions:
opus-mt-en-esopus-mt-fr-es
Build converted models with:
pixi run -e convert convert-mtThe deploy artifacts for the Space are kept separate from the source repo root:
hf_deploy/space/app.pyhf_deploy/space/README.mdhf_deploy/space/requirements.txthf_deploy/space/.hfignore
Deploy with:
hf_deploy/deploy.shFor app-only updates after the model repo is already populated:
hf_deploy/deploy.sh --app-onlySee hf_deploy/README.md for repository setup and deploy variants.