My Tiny Audio (Qwen3.5-0.8B + Granite Speech 5.0)
A lightweight, hackable, end-to-end Speech-to-Text Large Language Model.
📖 Model Overview
my-tiny-audio is a lightweight multimodal speech recognition model built with:
- Audio Encoder (Frozen):
ibm-granite/granite-speech-5.0-470m-turboctc-nc(470M Conformer-based feature extractor). - Audio Projector (Trained): 2-layer MLP projector (
1024→1024GELU →1024) with frame pooling stride 1. - Text Decoder (Fine-tuned & Merged):
Qwen/Qwen3.5-0.8Bwith LoRA adapter ($r=16, \alpha=32$) mathematically fused into the base weights viamerge_and_unload(). - Quantized GGUF Exports: Both full precision (BF16) and 8-bit quantized (
Q8_0) GGUF files included for nativellama.cppandOllamadeployment.
📊 Training Specifications
- Hardware: Single consumer GPU (NVIDIA GeForce RTX 4060 8GB VRAM).
- Dataset: LibriSpeech ASR
clean/validation(dev-clean, 5.4 hours audio). - Batching: Per-device batch size 2, gradient accumulation steps 2 (effective batch size 4).
- Optimization: AdamW ($\text{LR}=2\times 10^{-4}$ with warmup and cosine decay).
- Convergence:
- Initial Loss: 4.238 (Step 1)
- Final Loss: 0.1069 (Step 800)
- Status: Successfully converged with stable gradients.
📦 Repository Structure
aaron-hu26/my-tiny-audio/
├── model.safetensors # 1.51 GB (Unified weights: trained Projector + merged Qwen3.5-0.8B)
├── config.json # Root multimodal ASRConfig with Hugging Face auto_map
├── preprocessor_config.json # Granite Speech 5.0 feature extraction config
├── tokenizer.json # Aligned 248k vocab tokenizer
├── tokenizer_config.json # Tokenizer configuration
├── chat_template.jinja # Chat template
├── asr_modeling.py # Custom multimodal ASR architecture
├── asr_pipeline.py # Custom ASR pipeline implementation
├── projectors.py # MLP audio projector definition
├── requirements.txt # Inference dependencies
├── qwen_decoder_q8_0.gguf # 775 MB (8-bit quantized GGUF for Ollama/llama.cpp)
├── qwen_decoder.gguf # 1.51 GB (BF16 lossless GGUF)
├── Modelfile # Ollama model definition file
├── app.py # Single-file Gradio web demo with microphone & metrics
└── decoder/ # Standalone merged Qwen3.5-0.8B text decoder
🚀 Quickstart
1. Hugging Face Pipeline (Standard & Recommended)
You can load and run the model directly from the Hugging Face Hub using the standard transformers pipeline:
from transformers import pipeline
pipe = pipeline(
"automatic-speech-recognition",
model="aaron-hu26/my-tiny-audio",
trust_remote_code=True,
device="cuda", # 或 "cpu"
)
print(pipe("/tmp/test_audio.wav")["text"])
2. Standalone Web UI (Microphone & Audio Upload)
You can launch the complete Web UI with a single command:
git clone https://huggingface.co/aaron-hu26/my-tiny-audio
cd my-tiny-audio
pip install -r requirements.txt gradio
python app.py
Open http://localhost:7860 to record from your microphone or upload any WAV/MP3/FLAC audio with live RTF and throughput metrics.
3. Run GGUF with Ollama
The repository bundles an 8-bit quantized GGUF model (qwen_decoder_q8_0.gguf) and a ready-to-use Modelfile:
# Register the model in Ollama
ollama create my-tiny-audio -f Modelfile
# Run interactive conversation
ollama run my-tiny-audio
📄 License & Attribution
- Built using the tiny-audio architecture.
- Base models: Granite Speech 5.0 by IBM and Qwen3.5-0.8B by Alibaba Cloud Qwen Team.
- License: MIT License.