Views
No views yet
tarteel-ai/whisper-tiny-ar-quran.
The decoder exports cross-attention tensors and the generation config contains
Whisper alignment heads, enabling word-level timestamps in Transformers.js.1import { pipeline } from "@huggingface/transformers";
2
3const transcriber = await pipeline(
4 "automatic-speech-recognition",
5 "Sharjeelbaig/whisper-tiny-ar-quran-onnx",
6 { dtype: "q8" },
7);
8
9const result = await transcriber(audioFloat32Array, {
10 language: "ar",
11 task: "transcribe",
12 return_timestamps: "word",
13});@huggingface/transformers 4.2.0 in Node.js.
It returned the correct text and four timestamped words for Qur'an 1:1. A
second-reciter test on Husary's complete Sūrah 112 found all four verses and
aligned all 15 canonical words from 16 recognized tokens. The artifact was also
exercised end to end by transcribe-quran, including offline cached inference,
canonical matching, ASS generation, and FFmpeg/libass video rendering.| File | SHA-256 |
|---|---|
encoder_model.onnx | f0c604c7ea767c1eab1d26df50dbc3afa861cc28a1a68bd965e6b9e897c5b5c8 |
decoder_model_merged.onnx | 52ed5be1e5db4f213578d0ba6fc5f207bda119e130954855240b44ec5563272b |
encoder_model_quantized.onnx | 965e0ca31daf589ffb572e8b6deb1a4e65ad72221c1873c952331ff1c52f50c1 |
decoder_model_merged_quantized.onnx | 06a5c4409988b9ae7747bd55cf81e3851e3f2238536c86467963e0241464f652 |
convert-model.py is the reproducible development-only exporter. It enables
eager attention and explicitly exposes encoder, decoder, and cross-attention
outputs before Optimum merges the cached and non-cached decoder graphs.1uv run --python 3.12 \
2 --with torch --with accelerate --with 'optimum-onnx[onnxruntime]' \
3 python convert-model.py --output export
4
5uvx --python 3.12 --with torch --with accelerate \
6 --from 'optimum-onnx[onnxruntime]' optimum-cli onnxruntime quantize \
7 --onnx_model export --arm64 --per_channel -o quantizedonnx/*_quantized.onnx files are the encoder and merged decoder
from that quantized output, using Transformers.js's _quantized q8 filename
convention. The full generation metadata comes from the matching multilingual
Whisper Tiny generation config.