Views
No views yet
Audio → [Whisper/MMS Encoder] → [1D CNN Downsample] → [QFormer] → [MLP Projection] → [LLM (Aya-101/Aya-23)]
(frozen) (trainable) (trainable) (trainable) (frozen/LoRA)pip install -r requirements.txt1python train.py \
2 --speech-encoder-name openai/whisper-large-v3 \
3 --llm-name CohereLabs/aya-101 \
4 --data-path ./data/train.jsonl \
5 --eval-data-path ./data/eval.jsonl \
6 --output-dir ./outputs \
7 --num-epochs 3 \
8 --batch-size 4 \
9 --gradient-accumulation-steps 41python train.py \
2 --speech-encoder-name openai/whisper-large-v3 \
3 --llm-name CohereLabs/aya-101 \
4 --stage1-data ./data/asr_corpus.jsonl \
5 --stage1-epochs 2 \
6 --stage1-lr 5e-5 \
7 --stage2-data ./data/translation_pairs.jsonl \
8 --stage2-epochs 3 \
9 --stage2-lr 3e-5 \
10 --stage3-data ./data/target_language.jsonl \
11 --stage3-epochs 2 \
12 --stage3-lr 1e-5 \
13 --output-dir ./outputs \
14 --batch-size 4 \
15 --use-lora1python inference.py \
2 --model-path ./outputs/stage2_translation_final \
3 --audio-path ./audio/sample.wav \
4 --task translation \
5 --source-lang sw \
6 --target-lang en1{
2 "audio": "/path/to/audio.wav",
3 "text": "The transcription or translation text",
4 "task": "asr",
5 "source_lang": "sw",
6 "target_lang": "sw"
7}1{
2 "audio": {"array": [0.0, 0.01, ...], "sampling_rate": 16000},
3 "text": "The text",
4 "task": "translation",
5 "source_lang": "sw",
6 "target_lang": "en"
7}| Config | Encoder | LLM | Queries | CNN Layers | Stage | Best For |
|---|---|---|---|---|---|---|
| Standard | whisper-large-v3 | Aya-101 | 64 | 2 | Curriculum | General multilingual ST |
| Low-Resource | mms-1b-all | Aya-101 | 32 | 2 | ASR-only | Languages with <10h data |
| Speed | whisper-turbo | Aya-23-8B | 32 | 2 | Single | Real-time inference |
| Quality | whisper-large-v3 | Aya-23-35B | 150 | 2 | Full | Best translation quality |
.
├── model.py # SpeechLLM model definition
├── train.py # Training script with curriculum stages
├── inference.py # Inference/generation script
├── data_utils.py # Dataset and collation utilities
├── data_prep.py # Data preparation and pseudo-labeling
├── requirements.txt # Python dependencies
└── README.md # This file1@article{speechllm2025,
2 title={Speech-to-Text Translation with LLM Adapters},
3 year={2025}
4}