Downloads · 30 days
23
12% of all-time downloads
wasimlhr/whisper-quran-v1-onnx-quantized
whisper-quran-v1-onnx-quantized is a automatic speech recognition model from wasimlhr. Use it when you need speech turned into text. It is set up for optimum. The card lists the license as cc-by-nc-4.0.
ONNX export of wasimlhr/whisper-quran-v1 with dynamic int8 quantization for fast inference on CPU or GPU.
Downloads · 30 days
23
12% of all-time downloads
All-time downloads
187
Public
Repo size
1.6 GB
Likes
0
Public
Click a slice to open those files.
.onnx1.6 GB · 100%
From the Hugging Face model README
ONNX export of wasimlhr/whisper-quran-v1 with dynamic int8 quantization for fast inference on CPU or GPU.
Same fine-tuned Quran recitation model, exported to ONNX and quantized with ONNX Runtime. ~1.6 GB, runs with ONNX Runtime (no bitsandbytes). Ideal for Modal, Inference Endpoints, or self-hosted servers.
| Metric | Value |
|---|---|
| Parent model | wasimlhr/whisper-quran-v1 |
| Format | ONNX, dynamic int8 |
| Model size | ~1.6 GB |
| Use case | Quran ayah transcription |
from optimum.onnxruntime import ORTModelForSpeechSeq2Seq
from transformers import WhisperProcessor, pipeline
model = ORTModelForSpeechSeq2Seq.from_pretrained("wasimlhr/whisper-quran-v1-onnx-quantized")
processor = WhisperProcessor.from_pretrained("wasimlhr/whisper-quran-v1-onnx-quantized")
pipe = pipeline(
"automatic-speech-recognition",
model=model,
tokenizer=processor.tokenizer,
feature_extractor=processor.feature_extractor,
)
result = pipe(
"recitation.wav",
return_timestamps="word",
generate_kwargs={"language": "ar", "task": "transcribe", "max_new_tokens": 448}
)
print(result["text"])
print(result["chunks"]) # [{"text": "word", "timestamp": (start, end)}, ...]
This repo includes a custom handler and requirements.txt so you can deploy it as an Inference Endpoint:
handler.py and install deps from requirements.txt (optimum, onnxruntime-gpu, etc.). Task will show as Custom.{"inputs": "<base64-encoded-audio>", "parameters": {"return_timestamps": true, "language": "ar", "task": "transcribe"}}. Response: {"text": "...", "chunks": [{"text": "word", "start": 0.0, "end": 0.5}, ...]}.Use this endpoint URL as WHISPER_ENDPOINT_URL in your app (same as for Modal).
Use the included Modal app to serve this model as an HTTP API (same interface as the int8/int4 PyTorch deployments).
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | / | Model card JSON (model id, description, language). |
| POST | / | Transcribe — body: raw WAV bytes. Query: ?language=ar&task=transcribe&return_timestamps=true. Returns {"text": "...", "chunks": [{"text": "word", "start": 0.0, "end": 0.5}, ...]}. |
Deploy
pip install modal
cd modal_whisper_onnx
modal deploy app.py
Set your backend WHISPER_ENDPOINT_URL to the URL Modal prints (e.g. https://your-workspace--whisper-quran-onnx-web.modal.run).
Optional: If the endpoint uses proxy auth, set MODAL_KEY and MODAL_SECRET in your backend .env.
The Modal app lives in the same repo as this model: clone the repo and use the modal_whisper_onnx/ folder, or copy app.py and handler.py from the model’s Files tab once the card is updated.
Same as parent model: CC-BY-NC-4.0 — free for personal, educational, and non-commercial use.