orukeet / transformers /README.md
NathanRoll's picture
Add qualified Transformers FP32 export for standard Parakeet clients
10b603f verified
|
Raw
History Blame Contribute Delete
3.6 kB
# Transformers FP32 export
This export uses the standard `ParakeetForTDT` implementation in Transformers
5.15.1. No custom model code or `trust_remote_code` is required. Root-level
configuration, processor and safetensors files let applications such as Buzz load
`oruk/orukeet` through their existing Hugging Face/Parakeet backend.
```sh
pip install 'torch==2.8.0' 'torchaudio==2.8.0' 'transformers==5.15.1' soundfile
```
```python
import soundfile as sf
from transformers import AutoModelForTDT, AutoProcessor, pipeline
model = AutoModelForTDT.from_pretrained("oruk/orukeet", dtype="float32")
processor = AutoProcessor.from_pretrained("oruk/orukeet")
asr = pipeline(
"automatic-speech-recognition", model=model, device="cpu",
tokenizer=processor.tokenizer, feature_extractor=processor.feature_extractor,
)
audio, sample_rate = sf.read("speech.wav", dtype="float32")
assert sample_rate == 16000 and audio.ndim == 1
print(asr(audio)["text"])
```
Use 16 kHz mono audio. The model detects language automatically and does not
provide translation, speaker labels or prompt-conditioned transcription. Buzz
currently returns 30-second chunk boundaries, not aligned word timestamps.
Downloading the required configuration uses Hugging Face's normal model download
accounting. Cached local loading does not require an extra tracking request.
## Conversion
The source is `orukeet-v0.1.0.nemo` at revision
`555136b50265a132d4cea0d35560c26fc4f657ab`, SHA-256
`031c8ddab4845aeced904a7cde8e8aa57993b2e344716cf83a545b079c473b56`.
All 723 mapped tensors load with `strict=True`: 627,008,134 parameters in FP32.
The materialized Gabor filters are preserved as ordinary convolution weights.
The bundled upstream converter comes from Transformers commit
`6c6bac29f50c8aad5d1f06c72b2f892a6e335dd0`. The wrapper verifies the source hash,
extracts it with the data safety filter, and requires exact state-dictionary and
tokenizer compatibility before saving. Reproduce in Python 3.13:
```sh
pip install 'torch==2.8.0' 'transformers==5.15.1' protobuf sentencepiece pyyaml
python convert.py /path/to/output
```
Download both `convert.py` and `convert_nemo_to_hf.py` from this directory.
[`manifest.json`](manifest.json) records every exported runtime file's hash and size.
Weights remain CC BY-SA 4.0 with NVIDIA attribution; see the root `NOTICE.md` and
`LICENSE-WEIGHTS`. The upstream converter is Apache-2.0; see `LICENSE-CONVERTER`.
## Qualification
On Apple M5 Max CPU with PyTorch 2.8.0 and Transformers 5.15.1:
- The actual Buzz transcription path passed English, German, Spanish and French
repeated transcription, 0.1/1/5-second silence, a recording spanning two chunks,
and local loading/inference with socket connections disabled.
- A fixed 120-clip, six-language FLEURS validation compatibility sample produced
the same normalized transcript as the recorded source-NeMo output for 117 clips.
Pooled WER was **5.43% for this export versus 5.34% for source NeMo** using the
same normalization: two additional word errors across 2,433 reference words.
- The sample contained 1,257.82 seconds of audio and took 217.64 seconds of inference
across eight CPU threads (about 0.17 real-time factor). Other work ran on the
machine during this check; this is a runtime receipt, not a controlled speed
comparison with Parakeet.
This small compatibility sample is not a new held-out benchmark. The published
25-language NeMo results in the model card do not automatically transfer to this
export. Per-language measurements and normalization are in
[`qualification.json`](qualification.json).