MedASR β Core ML / Apple Neural Engine
Modified model: Muesli-HQ conversion of Google MedASR, pinned to ae1e4845b4b07479735d93e1e591e566435b7104. Original model by Google; conversion is not Google-endorsed. See MODIFICATIONS.md.
English-only 105M Conformer-CTC model for medical dictation. Internal FP16 weights, FP32 features/logits. Approximately 211 MB for the model package. Requires a model-specific frontend and CTC decoding; this is not a Transformers checkpoint or a registered FluidAudio model.
Access and license
This model and all model derivatives are provided under the complete HAI-DEF Terms of Use. Section 3.2 use restrictions are binding terms governing access, use and redistribution. The incorporated Prohibited Use Policy also applies. See the required Notice. No Hugging Face account or token is required to download. By downloading, using or redistributing this model, you agree to the attached HAI-DEF Terms of Use; Section 3.2 and the incorporated Prohibited Use Policy are binding restrictions on use and redistribution. Distributors must pass on the agreement and restrictions. Muesli asks users to review and accept these terms in the app or CLI before downloading or preparing the model. Conversion source under conversion/ is Apache-2.0; this does not relicense the weights.
Runtime contract
| Input/output | Type | Shape |
|---|---|---|
input_features |
float32 | [1, 1998, 128] |
feature_lengths |
int32 | [1] |
logits |
float32 | [1, 497, 512] |
- 16 kHz mono; 20-second padded window. Valid lengths derive from two unpadded kernel-5, stride-2 convolutions. Decode only valid frames; CTC blank ID 0.
- Frontend: symmetric Hann400, FFT512, hop160, no centering/preemphasis; natural log clamped at
1e-5. Use the shipped HTK/Kaldi 125β7500 Hzmel-filterbank.f32andwindow.f32, not NeMo/Parakeet defaults. - Architecture: 17 Conformer blocks, hidden512, eight attention heads, RoPE, CTC512. No TDT/RNN-T joint or external language model is required for greedy decoding.
- Raw output retains formatting tokens such as
{period}and{colon}. A downstream application must decide how to render them. - Target iOS17 / macOS14, but actual validation is limited to the M5/macOS26 environment below. Lower deployment target is not evidence of testing on older devices/OS versions.
Download and load
After obtaining access with a Hugging Face account/token:
from huggingface_hub import snapshot_download
directory = snapshot_download("Muesli-HQ/medasr-coreml")
# For reproducibility, add revision="<verified commit SHA>" from the Files history.
Load MedASR.mlpackage with Core ML and .cpuAndNeuralEngine, supplying the exact features and valid lengths above. For a working Swift example that reuses FluidAudio's AudioConverter, configurable AudioMelSpectrogram and CTC decoder, see conversion/swift-probe. The probe processes only the first model window. Full-file chunk overlap/stitching, ownership/cancellation and app/CLI integration remain downstream work.
The Swift example pins FluidAudio upstream e15287985625dbf544a343df679436789ffb03fb (0.18.0 base). Older 0.17.3 has CTC helpers but lacks the custom mel-table injection used here.
Conversion and validation
- Naive FP16 overflows on this checkpoint. Exact power-of-two subsampler/first-block reparameterization avoids those large activations. Kernel-32 grouped convolutions are decomposed into four kernel-8 sums for ANE support. FP32 graph rewrites are checked against the unchanged official PyTorch model before export.
- Fresh rebuild: official medical sample tested window by window on CPU, GPU and ANE; PyTorch/Core ML reference tokens agree. Ten real-artifact regression tests pass, including the FluidAudio Swift frontend and decoder. See rebuild summary.
- Compute plan on Apple M5: 1270 ANE operations and five small CPU mask/type operations; estimated compute cost rounds to 100% ANE. Host audio preprocessing and CTC decoding still run on CPU. Warm model prediction was approximately 21β22 ms per padded 20-second window in the original investigation; this excludes first preparation and host processing.
- Earlier broader investigation: 24 recordings / 261.905 seconds / 26 windows. All numerical thresholds passed; ANE collapsed tokens matched on 24/26 windows, including all medical windows. Two general-speech windows differ. This is not a lossless conversion. The historical report retains the failed exact-transcript gate.
- CPU-only FP16 was less faithful than ANE/GPU in that broader comparison. Validate an FP32 fallback separately; do not assume this artifact behaves identically across compute units.
- No independent clinical corpus, M1βM4/iPhone coverage, older-OS compatibility validation or shipping application integration has been established. Numerical conversion parity is not clinical-quality validation.
Exact source hashes are in source provenance; published file hashes are in manifest.json. Reproducible converter, locked dependencies, tests and Swift probe are preserved under conversion/. No source checkpoint, audio recording or local-user data is included in this distribution.
- Downloads last month
- 49
Model tree for Muesli-HQ/medasr-coreml
Base model
google/medasr