Views
No views yet
web_asr.py) for quick streaming and offline inference testing.data_local/ — Where your processed JSONL data (train, validation, test) and 16kHz WAVs live.models/ — Original base model weights (Qwen3-ASR-1.7B or 0.6B).checkpoints_bangla_lora/ — The output directory for LoRA adapters during training.prep_data.py
Handles dataset downloading, preprocessing, resampling to 16kHz (mono), and strictly normalizing Bengali Unicode strings via bnunicodenormalizer. It generates the train.jsonl and validation.jsonl files.train_qwen3_lora.py
The core training script. It patches the internal Qwen3 thinker forward pass, automatically manages LoRA wrapping, utilizes custom data collators (preventing audio duplication in cache), and avoids OOM issues with smart batching/cleanup callbacks.merge_lora.py
Fuses the trained LoRA adapter weights back into the base Qwen3-ASR-1.7B model, creating a standalone, fully capable inference model that doesn't rely on dynamically loading adapters.evaluate_lora.py
Extracts metrics (Word Error Rate / Character Error Rate) against your test dataset to measure how well the fine-tuning performed.test_inference.py
A lightweight script for running quick, pure-python terminal transcriptions to test adapters on the fly.web_asr.py
A responsive web application designed to load your model and expose an interactive GUI for microphone recordings and file uploads.uv. Important dependencies are listed in pyproject.toml.uv sync # Install dependencies (Transformers, PEFT, FLash Attention)16kHz and text is normalized.uv run prep_data.pyuv run train_qwen3_lora.pyBATCH_SIZE, LORA_RANK (16), and LR (2e-4) can be adjusted right at the top of the file depending on your VRAM limits.1# Evaluate the adapter's performance (WER/CER)
2uv run evaluate_lora.py
3
4# Merge the adapter permanently if you are satisfied
5uv run merge_lora.pyuv run web_asr.pyqwen_asr already on the repo. So no need to add qwen_asr on pyproject.toml.1from qwen_asr.inference.qwen3_asr import Qwen3ASRModel
2
3# Load the merged model (or base model)
4wrapper = Qwen3ASRModel.from_pretrained(
5 "./models/Qwen3-ASR-1.7B-Bengali-Merged",
6 max_inference_batch_size=32
7)
8
9# Run Transcription in Bengali
10predictions = wrapper.transcribe(
11 audio=["./test_audio.wav"],
12 language="Bengali"
13)
14print(predictions[0].text)61,000 cleaned and normalized audio samples (all <15s). The model was trained via LoRA for exactly 1 Epoch.2,000 randomly selected Bengali audio clips. These were used exclusively in evaluate_lora.py to calculate the final Word Error Rate (WER) and Character Error Rate (CER), ensuring no training data leakage.| Model | WER (%) | CER (%) | RTFx | Note |
|---|---|---|---|---|
| Qwen3-Bengali-LoRA (Ours) | 20.70% | 7.61% | 15.60x | Highly accurate transcriber across local dialects. |
| Base Qwen3-ASR (1.7B) | 72.25% | 41.79% | 28.44x | Failed to transcribe properly. Often hallucinated Hindi instead of Bengali. |
| Whisper Large-v3 | 73.11% | 29.31% | 4.41x | Evaluated using --language bn flag. Failed significantly on multi-dialect audio. |
language="Bengali" parameter in the transcribe methodology.language="bn" generation flag.1@article{Qwen3ASR,
2 title={Qwen3-ASR: A Unified Speech Recognition and Forced Alignment Model},
3 author={Qwen Team},
4 year={2026}
5}