Add files using upload-large-folder tool
Browse files- README.md +51 -45
- onnx/decoder_model_merged.onnx +2 -2
- onnx/decoder_model_merged_dyn.onnx +3 -0
- onnx/decoder_model_merged_q4.onnx +2 -2
- onnx/decoder_model_merged_q4_dyn.onnx +3 -0
README.md
CHANGED
|
@@ -1,45 +1,51 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
language:
|
| 4 |
-
- ar
|
| 5 |
-
- en
|
| 6 |
-
pipeline_tag: automatic-speech-recognition
|
| 7 |
-
tags:
|
| 8 |
-
- audio
|
| 9 |
-
- speech-recognition
|
| 10 |
-
- transcription
|
| 11 |
-
- onnx
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
---
|
| 16 |
-
|
| 17 |
-
# Cohere Transcribe Arabic
|
| 18 |
-
|
| 19 |
-
ONNX export of [
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- ar
|
| 5 |
+
- en
|
| 6 |
+
pipeline_tag: automatic-speech-recognition
|
| 7 |
+
tags:
|
| 8 |
+
- audio
|
| 9 |
+
- speech-recognition
|
| 10 |
+
- transcription
|
| 11 |
+
- onnx
|
| 12 |
+
- directml
|
| 13 |
+
base_model:
|
| 14 |
+
- CohereLabs/cohere-transcribe-arabic-07-2026
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# Cohere Transcribe Arabic 07-2026 β DirectML-optimized ONNX
|
| 18 |
+
|
| 19 |
+
ONNX export of [CohereLabs/cohere-transcribe-arabic-07-2026](https://huggingface.co/CohereLabs/cohere-transcribe-arabic-07-2026)
|
| 20 |
+
(2B, Arabic + English) restructured to run **fast on the ONNX Runtime DirectML EP**. Same
|
| 21 |
+
architecture as [cohere-transcribe-03-2026](https://huggingface.co/Masterx/cohere-transcribe-03-2026-ONNX),
|
| 22 |
+
hand-exported from the reference PyTorch weights (stock `optimum` can't export `cohere_asr`).
|
| 23 |
+
|
| 24 |
+
## What changed (`tools/onnx/cohere_decompose_attention.py` in [WinSTT](https://github.com/dahshury/WinSTT))
|
| 25 |
+
|
| 26 |
+
1. **Loop-invariant cross-KV hoisted into the encoder** β cross-attention K/V (which depend only on
|
| 27 |
+
the audio) are computed once per utterance in `encoder_model*.onnx`, not per decoded token.
|
| 28 |
+
2. **Static self-KV decode** β the self-attention KV cache is a fixed-length buffer updated by a
|
| 29 |
+
masked write, so the DirectML EP compiles the decoder **once** per utterance instead of re-fusing
|
| 30 |
+
its graph on every autoregressive step. Measured ~3.5 ms/token on DirectML (RTX 3080 Ti) vs
|
| 31 |
+
~16 ms/token on the CPU EP β **~4.6Γ faster**, entirely on the GPU.
|
| 32 |
+
|
| 33 |
+
Two decoders per precision (both fed by the hoisted encoder, sharing the decoder sidecar):
|
| 34 |
+
`decoder_model_merged*.onnx` (**static self-KV**, marker `winstt_static_kv`, fastest on DirectML) and
|
| 35 |
+
`decoder_model_merged*_dyn.onnx` (**growing self-KV**, faster on the CPU EP). WinSTT picks per device.
|
| 36 |
+
|
| 37 |
+
Numerically verified against the source on CPU (autoregressive logits parity: bit-exact fp32/q4).
|
| 38 |
+
|
| 39 |
+
**Notes vs the multilingual export:** this torch-traced graph uses a `(B, S, nh, hd)` head layout, so
|
| 40 |
+
the cross-attention is left dynamic (not padded to a fixed bucket) β perfectly fast for the β€10 s
|
| 41 |
+
segments a dictation VAD produces; only unrealistically long single clips would benefit from
|
| 42 |
+
bucketing. The **int8** decoder ships **dynamic-only** (`decoder_model_merged_int8.onnx` is the
|
| 43 |
+
growing-self graph): its `DynamicQuantizeLinear` scales interact badly with the fixed-KV write, so it
|
| 44 |
+
runs the hybrid path (encoder-DML / decoder-CPU). fp32 and q4 get the full static decode.
|
| 45 |
+
|
| 46 |
+
## Files
|
| 47 |
+
|
| 48 |
+
- `onnx/encoder_model[_int8|_q4].onnx` (+ external data) β hoisted encoders (cross-KV outputs).
|
| 49 |
+
- `onnx/decoder_model_merged[_q4].onnx` (+ `_dyn`) β static / dynamic decoders (fp32, q4).
|
| 50 |
+
- `onnx/decoder_model_merged_int8.onnx` β dynamic-only (int8).
|
| 51 |
+
- Tokenizer / configs β unchanged.
|
onnx/decoder_model_merged.onnx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5800d1290f24c78f312a57fb79e40cc7ef873df09e3c2870c66cd6744e52405a
|
| 3 |
+
size 134525
|
onnx/decoder_model_merged_dyn.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3b00b8c5744fa39b79d215bc9a53ebdc3c9d0a3ba7e4fa8272cfa6d5c0fba6b4
|
| 3 |
+
size 147878
|
onnx/decoder_model_merged_q4.onnx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5e9a47d683b5d89925c61ba4de6b69f142a08fa2b7fa877618aca9e5b5d7482e
|
| 3 |
+
size 152329
|
onnx/decoder_model_merged_q4_dyn.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3efcd8bc7ac501e6991fb9bb9677ad7143b88870aeac85a14b350cc4c88e62d7
|
| 3 |
+
size 165682
|