0
stars
0
commits
HTML
primary language
May 25, 2026
updated
BhashaBridge is an advanced, high-performance Speech-to-Text (ASR) transcription, translation, and AI-assisted post-processing pipeline. It is specifically optimized for bilingual Malayalam-English and English audio processing, delivering hyper-accurate, readable subtitle segments using state-of-the-art deep learning models.
The system consists of a robust FastAPI backend (incorporating Demucs, Silero VAD, Hugging Face Whisper pipelines, and native llama.cpp LLM inference) paired with a responsive Flutter UI frontend.
BhashaBridge runs a highly optimized, multi-stage processing pipeline on CUDA-capable GPUs:
[Audio Input]
│
▼
┌──────────────┐
│ Stage 1: │ ──► Demucs separates vocals from background noise/music
│ Demucs │
└──────────────┘
│
▼
┌──────────────┐
│ Stage 2: │ ──► Silero VAD crops active dialogue segments
│ Silero VAD │
└──────────────┘
│
▼
┌──────────────┐
│ Stage 2.5: │ ──► Consistent audio levels across crops
│ Peak Norm │
└──────────────┘
│
▼
┌──────────────┐
│ Stage 3 & 4: │ ──► whisper-medium-ml (Malayalam) or whisper-large-v3 (English)
│ ASR Pipeline │
└──────────────┘
│
▼
┌──────────────┐
│ Stage 5: │ ──► Accurate chunk start/end reconstruction
│ Align Timings│
└──────────────┘
│
▼
┌──────────────┐
│ Stage 6: │ ──► Gemma-4-E4B-it corrects text (Chillu / Lipi structure)
│ Gemma LLM │ while keeping exact segment structures
└──────────────┘
Separates vocals from backing tracks, background noise, or sound effects using the htdemucs model. Ensures Whisper only hears clean dialogue.
Uses Silero VAD to accurately isolate dialogue chunks in-memory. This prevents Whisper from hallucinating during long silent gaps.
Normalizes speech crops to a peak amplitude of 0.95 before ASR. This boosts quiet speakers and balances loud ones, improving transcription accuracy.
mal_to_mal): Transcribed via tomalex04/whisper-medium-ml-bf16-v2 with Flash Attention 2.mal_to_eng): Translated via openai/whisper-large-v3.eng_to_eng): Transcribed via openai/whisper-large-v3.Utilizes gemma-4-E4B-it (running locally via llama-cpp-python with full CUDA offloading). It operates on subtitle segments using deterministic Malayalam grammatical and orthographic rules:
ല്+ZWNJ ➔ ൽ, ര്+ZWNJ ➔ ർ).ffmpeg (for audio transcoding)Create and activate the conda environment using the provided environment.yml file:
# Clone the repository
git clone <your-repo-url>
cd BhashaBridge
# Create the environment from file
conda env create -f environment.yml
# Activate the environment
conda env activate bhashabridge
Alternatively, to install manual dependencies via requirements.txt:
conda create -n bhashabridge python=3.10 -y
conda activate bhashabridge
# Install PyTorch with CUDA support
pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu121
# Install packaging, ninja (required for compiling custom attention layers)
pip install packaging ninja
# Build and install llama-cpp-python from source with CUDA support
CMAKE_ARGS="-GGUIDE=OFF -DGGML_CUDA=on" FORCE_CMAKE=1 pip install llama-cpp-python --no-cache-dir
# Install rest of requirements
pip install -r requirements.txt
Create a .env file in the project root:
# Hugging Face Auth Token (for downloading gated repositories/models)
HF_TOKEN=your_hugging_face_write_token_here
# Server Bind Settings
SERVER_HOST=0.0.0.0
SERVER_PORT=8000
# Optional directory to save intermediate audio crops for diagnostics
DEBUG_AUDIO_CLIPS_PATH=audio_clips
Start the FastAPI server:
python server_gemma4.py
On first startup, BhashaBridge will automatically download and cache all necessary models (Gemma-4 GGUF quant, Whisper weights, Demucs, Silero VAD). Ensure you have a fast, stable internet connection.
Once running, interactive API docs are available at http://localhost:8000/docs.
POST /process_audio: Upload audio file with transcription_mode (mal_to_mal, mal_to_eng, or eng_to_eng). Returns a task_id.GET /task_status/{job_id}: Retrieves the status of a queued or running pipeline.GET /result/{job_id}: Gets final formatted subtitle segments.DELETE /cancel/{job_id}: Cancels a pending queued task.POST /post-process: Submits raw segments to the local Gemma model along with a prompt to clean/format/correct the output.The UI is built with Flutter, offering cross-platform support (Linux Desktop, macOS, Windows, Web, Android).
Navigate to the bhashabridge_ui directory and launch the app:
cd bhashabridge_ui
# Fetch packages
flutter pub get
# Run application (Make sure a target device is connected/running)
flutter run
To run VRAM diagnostics or test local model loading thresholds:
python vram_test.py
This script evaluates how Demucs, Silero VAD, Whisper, and Gemma offload to CUDA without overflowing available GPU memory.
HTML
53.8%
Python
15.5%
Dart
10.8%
C++
10.1%
CMake
8.1%
0
stars
0
commits
HTML
primary language
May 25, 2026
updated
BhashaBridge is an advanced, high-performance Speech-to-Text (ASR) transcription, translation, and AI-assisted post-processing pipeline. It is specifically optimized for bilingual Malayalam-English and English audio processing, delivering hyper-accurate, readable subtitle segments using state-of-the-art deep learning models.
The system consists of a robust FastAPI backend (incorporating Demucs, Silero VAD, Hugging Face Whisper pipelines, and native llama.cpp LLM inference) paired with a responsive Flutter UI frontend.
BhashaBridge runs a highly optimized, multi-stage processing pipeline on CUDA-capable GPUs:
[Audio Input]
│
▼
┌──────────────┐
│ Stage 1: │ ──► Demucs separates vocals from background noise/music
│ Demucs │
└──────────────┘
│
▼
┌──────────────┐
│ Stage 2: │ ──► Silero VAD crops active dialogue segments
│ Silero VAD │
└──────────────┘
│
▼
┌──────────────┐
│ Stage 2.5: │ ──► Consistent audio levels across crops
│ Peak Norm │
└──────────────┘
│
▼
┌──────────────┐
│ Stage 3 & 4: │ ──► whisper-medium-ml (Malayalam) or whisper-large-v3 (English)
│ ASR Pipeline │
└──────────────┘
│
▼
┌──────────────┐
│ Stage 5: │ ──► Accurate chunk start/end reconstruction
│ Align Timings│
└──────────────┘
│
▼
┌──────────────┐
│ Stage 6: │ ──► Gemma-4-E4B-it corrects text (Chillu / Lipi structure)
│ Gemma LLM │ while keeping exact segment structures
└──────────────┘
Separates vocals from backing tracks, background noise, or sound effects using the htdemucs model. Ensures Whisper only hears clean dialogue.
Uses Silero VAD to accurately isolate dialogue chunks in-memory. This prevents Whisper from hallucinating during long silent gaps.
Normalizes speech crops to a peak amplitude of 0.95 before ASR. This boosts quiet speakers and balances loud ones, improving transcription accuracy.
mal_to_mal): Transcribed via tomalex04/whisper-medium-ml-bf16-v2 with Flash Attention 2.mal_to_eng): Translated via openai/whisper-large-v3.eng_to_eng): Transcribed via openai/whisper-large-v3.Utilizes gemma-4-E4B-it (running locally via llama-cpp-python with full CUDA offloading). It operates on subtitle segments using deterministic Malayalam grammatical and orthographic rules:
ല്+ZWNJ ➔ ൽ, ര്+ZWNJ ➔ ർ).ffmpeg (for audio transcoding)Create and activate the conda environment using the provided environment.yml file:
# Clone the repository
git clone <your-repo-url>
cd BhashaBridge
# Create the environment from file
conda env create -f environment.yml
# Activate the environment
conda env activate bhashabridge
Alternatively, to install manual dependencies via requirements.txt:
conda create -n bhashabridge python=3.10 -y
conda activate bhashabridge
# Install PyTorch with CUDA support
pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu121
# Install packaging, ninja (required for compiling custom attention layers)
pip install packaging ninja
# Build and install llama-cpp-python from source with CUDA support
CMAKE_ARGS="-GGUIDE=OFF -DGGML_CUDA=on" FORCE_CMAKE=1 pip install llama-cpp-python --no-cache-dir
# Install rest of requirements
pip install -r requirements.txt
Create a .env file in the project root:
# Hugging Face Auth Token (for downloading gated repositories/models)
HF_TOKEN=your_hugging_face_write_token_here
# Server Bind Settings
SERVER_HOST=0.0.0.0
SERVER_PORT=8000
# Optional directory to save intermediate audio crops for diagnostics
DEBUG_AUDIO_CLIPS_PATH=audio_clips
Start the FastAPI server:
python server_gemma4.py
On first startup, BhashaBridge will automatically download and cache all necessary models (Gemma-4 GGUF quant, Whisper weights, Demucs, Silero VAD). Ensure you have a fast, stable internet connection.
Once running, interactive API docs are available at http://localhost:8000/docs.
POST /process_audio: Upload audio file with transcription_mode (mal_to_mal, mal_to_eng, or eng_to_eng). Returns a task_id.GET /task_status/{job_id}: Retrieves the status of a queued or running pipeline.GET /result/{job_id}: Gets final formatted subtitle segments.DELETE /cancel/{job_id}: Cancels a pending queued task.POST /post-process: Submits raw segments to the local Gemma model along with a prompt to clean/format/correct the output.The UI is built with Flutter, offering cross-platform support (Linux Desktop, macOS, Windows, Web, Android).
Navigate to the bhashabridge_ui directory and launch the app:
cd bhashabridge_ui
# Fetch packages
flutter pub get
# Run application (Make sure a target device is connected/running)
flutter run
To run VRAM diagnostics or test local model loading thresholds:
python vram_test.py
This script evaluates how Demucs, Silero VAD, Whisper, and Gemma offload to CUDA without overflowing available GPU memory.
HTML
53.8%
Python
15.5%
Dart
10.8%
C++
10.1%
CMake
8.1%