Downloads · 30 days
0
bizenlabs/medasr-onnx
medasr-onnx is a machine learning model from bizenlabs. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
ONNX-exported variants of google/medasr for local, offline medical speech recognition.
Downloads · 30 days
0
Access
Public
Updated Feb 20, 2026
Repo size
576 MB
Likes
0
Public
Click a slice to open those files.
.onnx576 MB · 100%
From the Hugging Face model README
ONNX-exported variants of google/medasr for local, offline medical speech recognition.
Published at: bizenlabs/medasr-onnx
| Variant | File | Size | Precision | Use Case |
|---|---|---|---|---|
| FP32 | model-fp32.onnx | 405 MB | Full | Baseline — highest accuracy |
| FP16 | model-fp16.onnx | 204 MB | Mixed | Smaller footprint (auto-rejected if accuracy degrades) |
| INT8 | model-int8.onnx | 149 MB | Quantized | Low-resource CPU — 1.8x faster, 2.7x smaller |
import numpy as np
import onnxruntime as ort
from transformers import AutoProcessor
processor = AutoProcessor.from_pretrained("google/medasr", trust_remote_code=True)
session = ort.InferenceSession("model-fp32.onnx", providers=["CPUExecutionProvider"])
# audio: float32 numpy array, mono, 16 kHz
encoded = processor(audio, sampling_rate=16000, return_tensors="np", padding=True)
feed = {"input_features": encoded["input_features"]}
if "attention_mask" in encoded:
feed["attention_mask"] = encoded["attention_mask"]
logits = session.run(None, feed)[0]
token_ids = np.argmax(logits, axis=-1)
text = processor.batch_decode(token_ids)[0]
| Spec | Value |
|---|---|
| Architecture | Conformer-CTC (LasrForCTC) |
| Parameters | 105M |
| Input | 16 kHz mono audio |
| Vocab size | 512 |
| Training data | ~5,000 hours physician dictations |
| WER (radiology) | 4.6% |
| License | Apache 2.0 (code) + HAI-DEF (weights) |
| Source | google/medasr |
torch.onnx.export using legacy TorchScript path (dynamo=False)See CONVERSION.md for the full process, key decisions, and reconversion checklist.
| File | Purpose |
|---|---|
convert_medasr.py | Self-contained conversion script: export + quantize + validate + manifest |
upload.py | Upload artifacts to HuggingFace Hub |
requirements.lock.txt | Pinned Python dependencies |
CONVERSION.md | Detailed conversion process, key decisions, and reconversion checklist |
cd tools/medasr-onnx
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.lock.txt
Login to Hugging Face (required for gated model access):
huggingface-cli login
python convert_medasr.py \
--model-id google/medasr \
--version 2026.02.20 \
--output-dir ./artifacts
The script will:
manifest.json with SHA256 checksums for all passing variantsTo skip FP16 entirely:
python convert_medasr.py \
--model-id google/medasr \
--version 2026.02.20 \
--output-dir ./artifacts \
--skip-fp16
Preview what will be uploaded:
python upload.py --version 2026.02.20 --dry-run
Upload all passing variants:
python upload.py --version 2026.02.20
Upload specific variants only:
python upload.py --version 2026.02.20 --variants fp32 int8
When Google releases a new MedASR version:
requirements.lock.txt if the model card specifies a new commitpython convert_medasr.py --model-id google/medasr --version YYYY.MM.DDpython upload.py --version YYYY.MM.DDSee CONVERSION.md for the full reconversion checklist.
ONNX conversion code: Apache 2.0 Model weights: subject to google/medasr license (Apache 2.0 code + HAI-DEF weights)