Downloads · 30 days
16
7% of all-time downloads
cmaree/Bagus-whisper-small-id-onnx
Bagus-whisper-small-id-onnx is a automatic speech recognition model from cmaree. Use it when you need speech turned into text. It is set up for transformers.js. The card lists the license as apache-2.0.
This is an ONNX-converted version of Bagus/whisper-small-id-cv17, optimized for browser-based inference with Transformers.js.
Downloads · 30 days
16
7% of all-time downloads
All-time downloads
216
Public
Repo size
2.5 GB
Likes
0
Public
Click a slice to open those files.
.onnx1.8 GB · 100%
From the Hugging Face model README
This is an ONNX-converted version of Bagus/whisper-small-id-cv17, optimized for browser-based inference with Transformers.js.
Bagus/whisper-small-id-cv17 is a fine-tuned Whisper Small model for Indonesian automatic speech recognition (ASR). It achieves 5.9% Word Error Rate (WER) on Indonesian speech, making it one of the most accurate Indonesian ASR models available.
This ONNX version provides:
This repository includes multiple quantization levels optimized for different use cases:
| Quantization | Encoder | Decoder | Total Size | Use Case |
|---|---|---|---|---|
| q4f16 | 51 MB | 138 MB | ~191 MB | Recommended for browsers - Best balance |
| fp16 | 168 MB | 293 MB | ~463 MB | Higher quality, larger size |
| int8/q8 | 87 MB | 299 MB | ~386 MB | Good quality, moderate size |
| fp32 | 337 MB | 587 MB | ~924 MB | Full precision (reference) |
import { pipeline } from '@xenova/transformers';
// Create ASR pipeline
const transcriber = await pipeline(
'automatic-speech-recognition',
'cmaree/Bagus-whisper-small-id-onnx',
{
dtype: 'q4f16', // Recommended for browser
device: 'wasm', // or 'webgpu' if available
}
);
// Transcribe audio
const result = await transcriber(audioData, {
language: 'indonesian',
task: 'transcribe',
});
console.log(result.text);
import {
AutoProcessor,
AutoModelForSpeechSeq2Seq,
AutoTokenizer
} from '@xenova/transformers';
class IndonesianWhisper {
constructor() {
this.model = null;
this.processor = null;
this.tokenizer = null;
}
async load(options = {}) {
const modelId = 'cmaree/Bagus-whisper-small-id-onnx';
const device = options.device || 'wasm';
this.processor = await AutoProcessor.from_pretrained(modelId);
this.tokenizer = await AutoTokenizer.from_pretrained(modelId);
this.model = await AutoModelForSpeechSeq2Seq.from_pretrained(modelId, {
device: device,
dtype: device === 'webgpu' ? 'fp32' : 'q4f16'
});
}
async transcribe(audioData, options = {}) {
const processed = await this.processor(audioData, {
sampling_rate: options.sampling_rate || 16000
});
const outputs = await this.model.generate(processed.input_features, {
max_new_tokens: 128,
num_beams: 1,
language: 'indonesian',
task: 'transcribe',
return_timestamps: false,
});
const transcription = this.tokenizer.batch_decode(outputs, {
skip_special_tokens: true
});
return { text: transcription[0] };
}
}
// Usage
const whisper = new IndonesianWhisper();
await whisper.load({ device: 'wasm' });
const result = await whisper.transcribe(audioBuffer);
console.log(result.text);
Tested on typical hardware with WASM backend:
| Device | Browser | Speed (RTF) | Notes |
|---|---|---|---|
| Desktop (i7) | Chrome | ~0.3x | 3-4 seconds for 10s audio |
| Laptop (M1) | Safari | ~0.2x | 2-3 seconds for 10s audio |
| Mobile (Flagship) | Chrome | ~0.5x | 5-6 seconds for 10s audio |
RTF = Real-time Factor (lower is faster)
With WebGPU (when available):
Audio Quality: Performance degrades with:
Domain Specificity: Trained on Common Voice dataset
Resource Requirements:
@misc{bagus2024whisper,
author = {Bagus},
title = {Whisper Small Indonesian CV17},
year = {2024},
publisher = {HuggingFace},
url = {https://huggingface.co/Bagus/whisper-small-id-cv17}
}
@misc{radford2022whisper,
title={Robust Speech Recognition via Large-Scale Weak Supervision},
author={Alec Radford and Jong Wook Kim and Tao Xu and Greg Brockman and Christine McLeavey and Ilya Sutskever},
year={2022},
eprint={2212.04356},
archivePrefix={arXiv},
primaryClass={eess.AS}
}
@software{transformersjs,
author = {Xenova},
title = {Transformers.js: State-of-the-art Machine Learning for the web},
year = {2024},
url = {https://github.com/xenova/transformers.js}
}
For issues or questions about this ONNX version:
For the original model:
This model is released under the Apache 2.0 license, consistent with the original Whisper model and the fine-tuned version.