chore: drop unused faster-whisper/ctranslate2/requests deps
Browse filesVoice posing runs entirely in the browser via the Web Speech API
(fusion_ui.BROWSER_VOICE_JS); the server-side faster-whisper path in
src/buddy_fusion/asr.py is never imported by the app (verified: grep finds
no `import asr`, git history shows fusion_ui never imported it). The
faster-whisper / ctranslate2 / requests pins only served that dead code, so
remove them as dead weight on the Space image. requirements.txt keeps a
restore recipe in comments.
Document the finding in wiki/voice-input-asr.md (corrects an earlier draft
that wrongly claimed the Space runs faster-whisper).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- requirements.txt +8 -14
- wiki/index.md +3 -0
- wiki/log.md +12 -0
- wiki/voice-input-asr.md +72 -0
requirements.txt
CHANGED
|
@@ -13,17 +13,11 @@ llama-cpp-python==0.3.19
|
|
| 13 |
gradio==6.15.2
|
| 14 |
huggingface_hub>=1.17
|
| 15 |
spaces
|
| 16 |
-
#
|
| 17 |
-
#
|
| 18 |
-
# faster-whisper
|
| 19 |
-
#
|
| 20 |
-
#
|
| 21 |
-
#
|
| 22 |
-
|
| 23 |
-
#
|
| 24 |
-
# class of pin hazard as llama-cpp-python). >=4.5 needs cuDNN 9 + CUDA>=12.3,
|
| 25 |
-
# which torch==2.8.0 (cu128) provides. 4.8.0 is verified importable locally;
|
| 26 |
-
# confirm on the Space build log it installs without a cuDNN/CUDA error. If the
|
| 27 |
-
# Space build fails on cuDNN 9, 4.4.0 (cuDNN 8) is the fallback.
|
| 28 |
-
ctranslate2==4.8.0
|
| 29 |
-
requests
|
|
|
|
| 13 |
gradio==6.15.2
|
| 14 |
huggingface_hub>=1.17
|
| 15 |
spaces
|
| 16 |
+
# NOTE: voice posing runs entirely in the browser (Web Speech API). The
|
| 17 |
+
# server-side faster-whisper path in src/buddy_fusion/asr.py is never imported
|
| 18 |
+
# by the app, so faster-whisper / ctranslate2 (its CUDA backend) and the
|
| 19 |
+
# requests pin (added only so the unused ASR import would resolve) were removed
|
| 20 |
+
# as dead weight. See wiki/voice-input-asr.md. To restore the Whisper path:
|
| 21 |
+
# faster-whisper==1.1.0
|
| 22 |
+
# ctranslate2==4.8.0 # >=4.5 needs cuDNN 9 + CUDA>=12.3 (torch 2.8.0 cu128); 4.4.0 = cuDNN 8 fallback
|
| 23 |
+
# requests # hf_hub 1.x uses httpx and no longer pulls requests transitively
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wiki/index.md
CHANGED
|
@@ -26,6 +26,9 @@ See [README](README.md) for how this wiki works.
|
|
| 26 |
and the CPU-vs-ZeroGPU baseline.
|
| 27 |
- [gradio-embed-integration](gradio-embed-integration.md) - The Three.js voxel
|
| 28 |
embed init and the JS↔Python voice bridge inside `gr.HTML`.
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
## Debugging
|
| 31 |
|
|
|
|
| 26 |
and the CPU-vs-ZeroGPU baseline.
|
| 27 |
- [gradio-embed-integration](gradio-embed-integration.md) - The Three.js voxel
|
| 28 |
embed init and the JS↔Python voice bridge inside `gr.HTML`.
|
| 29 |
+
- [voice-input-asr](voice-input-asr.md) - Voice runs on browser Web Speech, NOT
|
| 30 |
+
faster-whisper; asr.py is unwired dead code and the faster-whisper dependency
|
| 31 |
+
is never exercised.
|
| 32 |
|
| 33 |
## Debugging
|
| 34 |
|
wiki/log.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
| 2 |
|
| 3 |
## 2026-06-14
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
### Voxel rendering page + turntable centering fix
|
| 6 |
|
| 7 |
- Added `voxel-rendering.md` documenting the voxelizer, bounds-driven camera,
|
|
|
|
| 2 |
|
| 3 |
## 2026-06-14
|
| 4 |
|
| 5 |
+
### Voice input ASR page (corrected)
|
| 6 |
+
|
| 7 |
+
- Added `voice-input-asr.md`. Initial draft wrongly claimed the Space runs
|
| 8 |
+
faster-whisper (inferred from `asr.py` defaults + `requirements.txt`).
|
| 9 |
+
Strict verification corrected this: `grep -rn "import asr"` returns zero
|
| 10 |
+
matches and `git log -S "import asr"` shows `fusion_ui` never imported it —
|
| 11 |
+
`asr.py` is unwired dead code. The live voice path is browser Web Speech
|
| 12 |
+
(`window.SpeechRecognition` in `fusion_ui.BROWSER_VOICE_JS`); the app only
|
| 13 |
+
ever handles the plain-text transcript. `faster-whisper`/`ctranslate2` are
|
| 14 |
+
installed but never exercised; `BUDDY_ASR_*` env vars have no effect.
|
| 15 |
+
- Linked it into `index.md` Integrations.
|
| 16 |
+
|
| 17 |
### Voxel rendering page + turntable centering fix
|
| 18 |
|
| 19 |
- Added `voxel-rendering.md` documenting the voxelizer, bounds-driven camera,
|
wiki/voice-input-asr.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Voice Input — Browser Web Speech (not faster-whisper)
|
| 3 |
+
tags: [architecture, asr, voice, deployment]
|
| 4 |
+
last_updated: 2026-06-14
|
| 5 |
+
confidence: high
|
| 6 |
+
sources:
|
| 7 |
+
- src/buddy_fusion/fusion_ui.py
|
| 8 |
+
- src/buddy_fusion/asr.py
|
| 9 |
+
- requirements.txt
|
| 10 |
+
related_pages:
|
| 11 |
+
- gradio-embed-integration.md
|
| 12 |
+
- system-overview.md
|
| 13 |
+
- deployment-strategy.md
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Voice Input — Browser Web Speech (not faster-whisper)
|
| 17 |
+
|
| 18 |
+
## Summary
|
| 19 |
+
|
| 20 |
+
Voice posing runs **entirely in the user's browser** via the Web Speech API.
|
| 21 |
+
The Space does **not** run faster-whisper for voice, despite `faster-whisper`
|
| 22 |
+
being in `requirements.txt` and a full server-side `asr.py` existing — that
|
| 23 |
+
module is **never imported by the app**. This page exists because the dependency
|
| 24 |
+
list and `asr.py` strongly imply a Whisper path that the wiring does not back.
|
| 25 |
+
|
| 26 |
+
## What actually runs
|
| 27 |
+
|
| 28 |
+
The only live voice path is the browser bridge in
|
| 29 |
+
[fusion_ui.py](../src/buddy_fusion/fusion_ui.py):
|
| 30 |
+
|
| 31 |
+
1. `BROWSER_VOICE_JS` (injected through `gr.HTML` head) starts
|
| 32 |
+
`window.SpeechRecognition || window.webkitSpeechRecognition` — browser-native
|
| 33 |
+
recognition, client-side, **no audio is uploaded to the server**.
|
| 34 |
+
2. A final transcript is written into a hidden Gradio textbox
|
| 35 |
+
(`#buddy-voice-transcript-in`) via the native value setter, then a hidden
|
| 36 |
+
submit button (`#buddy-voice-submit`) is clicked.
|
| 37 |
+
3. `voice_submit.click(on_voice, ...)` fires; `on_voice` receives the **plain
|
| 38 |
+
text** transcript and passes it to `runtime.interpret_genome_command`. No
|
| 39 |
+
`gr.Audio` component, no `transcribe()` call, no server-side STT.
|
| 40 |
+
|
| 41 |
+
So on the Space, speech-to-text is performed by the user's browser (Chrome et
|
| 42 |
+
al.), not by the app. Recognition quality and language coverage come from the
|
| 43 |
+
browser, not from any model the Space hosts.
|
| 44 |
+
|
| 45 |
+
## Why asr.py / faster-whisper are misleading
|
| 46 |
+
|
| 47 |
+
- `asr.py` wraps faster-whisper (`large-v3-turbo`, `@spaces.GPU`) behind a
|
| 48 |
+
`transcribe()` surface and reads `BUDDY_ASR_BACKEND`. It is a complete,
|
| 49 |
+
working implementation — but **dead code**: `grep -rn "import asr"` across
|
| 50 |
+
src + tests + `app.py` returns zero matches, and `git log -S "import asr"`
|
| 51 |
+
shows `fusion_ui` never imported it. It has shipped unwired since the initial
|
| 52 |
+
commit (357e825), most likely ported from build-a-buddy-hf's race_ui, which
|
| 53 |
+
did use a server-side path.
|
| 54 |
+
- `requirements.txt` still pins `faster-whisper==1.1.0` + `ctranslate2==4.8.0`.
|
| 55 |
+
These are installed on the Space but never exercised by any live code path —
|
| 56 |
+
dead weight on the image.
|
| 57 |
+
- `BUDDY_ASR_BACKEND` / `BUDDY_ASR_MODEL` / `BUDDY_ASR_BROWSER_LANG` are read
|
| 58 |
+
only inside `asr.py`, so setting them has **no effect** on the running app.
|
| 59 |
+
|
| 60 |
+
## Verification note
|
| 61 |
+
|
| 62 |
+
Do not infer the runtime ASR backend from `asr.py` defaults or
|
| 63 |
+
`requirements.txt`. Confirm wiring instead: search for an `import asr` / `from
|
| 64 |
+
.asr` and for a `gr.Audio` component feeding `transcribe()`. As of 2026-06-14
|
| 65 |
+
neither exists; the live path is browser Web Speech only.
|
| 66 |
+
|
| 67 |
+
## If the Whisper path is ever wanted
|
| 68 |
+
|
| 69 |
+
Wiring `asr.py` back in would need: a `gr.Audio(sources=["microphone"])`
|
| 70 |
+
component, an event that calls `asr.transcribe_with_language` on the recorded
|
| 71 |
+
file, and a `backend()` check to choose browser vs server. Until then, treat the
|
| 72 |
+
faster-whisper dependency as removable if image size matters.
|