🚀 Wav2Vec2 XLSR-56 (ONNX + Quantized, CPU Optimized)
📌 Overview
This repository provides a quantized ONNX version of Wav2Vec2 XLSR-56, optimized for fast, CPU-based speech recognition.
The model is designed for real-time transcription systems where GPU usage is limited or unavailable.
⚙️ Key Features
✅ ONNX runtime optimized
✅ INT8 Quantization applied
✅ ~2x faster inference on CPU
✅ Reduced memory footprint
✅ Production-ready for deployment
📦 Model Files
wav2vec2_quant.onnx → Quantized ONNX model
preprocessor_config.json → Audio preprocessing config
tokenizer_config.json → Tokenizer settings
vocab.json → Vocabulary file
special_tokens_map.json → Token mappings
📊 Performance Summary
| Metric | Original (PyTorch) | ONNX Quantized |
|---|
| Inference Speed | 1x | ~2x faster |
| Model Size | ~1.2 GB | 365 MB |
| Compression Ratio | — | ~70% smaller |
| Accuracy Drop (WER) | Baseline | ~2–5% drop |
| Hardware Requirement | GPU Recommended | CPU Optimized |
⚠️ Note: Benchmarks are based on internal testing and may vary depending on hardware and input audio.
🧠 Optimization Details
Converted from PyTorch → ONNX
Applied dynamic quantization (INT8)
Optimized for low-latency inference pipelines
Suitable for real-time ASR systems and streaming applications
💻 Usage Example
import onnxruntime as ort
import numpy as np
Load ONNX model
session = ort.InferenceSession("wav2vec2_quant.onnx")
Example input (replace with actual preprocessed audio)
input_values = np.random.rand(1, 16000).astype("float32")
Run inference
outputs = session.run(None, {"input_values": input_values})
print(outputs)
🎯 Use Cases
Real-time speech recognition
CPU-based transcription systems
Edge devices and low-resource environments
Backend ASR services
⚠️ Limitations
Slight accuracy drop (~2–5%) due to quantization
Requires proper preprocessing pipeline (Wav2Vec2 compatible)
Not fine-tuned for domain-specific datasets
🔖 Tags
automatic-speech-recognition wav2vec2 onnx quantization speech-recognition cpu-inference
📢 Final Note
This model is built for speed and efficiency, making it ideal for developers looking to deploy scalable ASR systems without GPU dependency.