Elhamdule Allah , 80mb onnx (int4,int8 mixed quantization)

#1

Masha'a Allah

Has same Accuracy and better usage on mobile
mobile-ready using sherpa onnx , already injected metadata into onnx and tokens.txt is ready elhamdule Allah

TheGreatQuran changed pull request title from Elahmdule Allah , 80mb onnx (int4,int8 mixed quantization) to Elhamdule Allah , 80mb onnx (int4,int8 mixed quantization)

Jazak Allah Khair for your contribution โ€” the effort to get this down to ~80 MB for on-device use is genuinely appreciated, and mobile deployment is exactly where I want this project to go.

That said, I can't merge this as a drop-in for the Quran model, and I wanted to explain why rather than just close it.

The tokens.txt in the PR has 1025 entries (vocab ~1024), but this model's tokenizer was trained specifically on Quranic text with a vocab size of 512 and character_coverage=1.0 to preserve all the harakat. So the vocabularies are a factor of two apart โ€” which suggests the ONNX here isn't derived from this fine-tuned checkpoint, but more likely from the base nvidia/stt_ar_fastconformer_hybrid_large_pcd_v1.0 (which ships with the larger MSA vocab).

The contents of the vocab point the same way. It contains general/MSA and dialect tokens like ุงู„ููŠุฏูŠูˆุŒ ุงู„ุฑุฆูŠุณุŒ ุงู„ูู†ุงู†ุŒ ู…ูˆู‚ุนุŒ ุจุงู„ู†ุณุจุฉุŒ ุนุดุงู†ุŒ ูƒุฏู‡ุŒ ุนู„ุดุงู† โ€” media-speech and colloquial Arabic. A tokenizer built for everyayah recitation wouldn't contain "the video" or Egyptian colloquialisms. Swapping this in would regress exactly the diacritic-sensitive Quranic accuracy that the model is meant for, so the "same accuracy" claim wouldn't hold for this use case even if the quantization itself is solid.

Could you share which base model and tokenizer you actually quantized, and on what data you measured WER? If this is a strong generic-Arabic quantized export, it's genuinely useful โ€” it would just be better as its own repo or a clearly labeled separate variant rather than merged into this Quranic model's main branch.

Thanks again for taking the time to put this together.

yes really you are right Iam so sorry
i uploaded a wrong tokens.txt from the base nvidia model (which i wrongly was testing the app with in flutter)
but the model is 100% quantized from the latest nemo here
I will upload data and upload the right tokens.txt
and i can upload the export scripts here insha'a Allah
and also the metadata here is injected according to this token ....i will upload the model free of metadata

but when itested for transcription even using the wrong tokens , it transcribed all words correctly 98% (i fed using a sliding window 30s ) masha'a Allah
thanks for your kindness

This comment has been hidden

I tried to export it again using the same nemo and i made sure of the nemo by checking the hash ...but the exported vocab.json wasn't the same as you described

and this was the exported "vocab.json" from "phase3_full_wer0.0014.nemo" using the "export_onnx.py"
i uploaded here the vocab.json and scripts used on the nemo to try
you can access here ( run the py files in order and nemo is in same directory )

Python Scripts and vocab.json

you can quantize and upload them in your folder in onnx folder
you can add
FP32
Q8
Mixed

Alongside there wer tests
the scripts used was from
Yazinsae Repo
Yazinsae Repo 2

if you want me to do this and you will approve them its ok <3

ุฑุจู†ุง ุชู‚ุจู„ ู…ู†ุง ุงู†ูƒ ุงู†ุช ุงู„ุณู…ูŠุน ุงู„ุนู„ูŠู…
May Allah Accept From us

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment