aufklarer commited on
Commit
d579a15
Β·
verified Β·
1 Parent(s): fbde3b1

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - multilingual
5
+ tags:
6
+ - automatic-speech-recognition
7
+ - coreml
8
+ - apple-silicon
9
+ - neural-engine
10
+ - wav2vec2
11
+ - ctc
12
+ - multilingual
13
+ - low-resource
14
+ base_model: facebook/omniASR-CTC-300M
15
+ library_name: coreml
16
+ pipeline_tag: automatic-speech-recognition
17
+ ---
18
+
19
+ # Omnilingual ASR β€” CTC 300M (CoreML INT8)
20
+
21
+ CoreML (`.mlpackage`) export of Meta's Omnilingual ASR CTC-300M model with
22
+ 8-bit weight palettization (k-means). Target deployment: iOS 17+ / macOS 14+
23
+ with Apple Neural Engine via the CPU+NE compute unit.
24
+
25
+ Omnilingual ASR is a wav2vec 2.0-style encoder-only model with a linear CTC
26
+ head, trained by Meta for speech recognition across **1,600+ languages**. The
27
+ CTC variant is language-agnostic at inference time (no language hint required).
28
+
29
+ ## Model
30
+
31
+ | | |
32
+ |---|---|
33
+ | Parameters | 326 M |
34
+ | Format | CoreML `.mlpackage` (MLProgram) |
35
+ | Precision | FP16 compute, INT8 palettized weights (k-means) |
36
+ | Min deployment target | iOS 17 / macOS 14 |
37
+ | Compute units | CPU + Neural Engine |
38
+ | Input | `audio` float32 `[1, N_samples]` (raw 16 kHz waveform, z-score normalized) |
39
+ | Output | `logits` float32 `[1, T, 10288]` where T = N_samples / 320 |
40
+ | Max duration | 5 s (configurable at export time) |
41
+ | Languages | 1,600+ |
42
+ | Vocabulary | 10,288 SentencePiece tokens |
43
+
44
+ The input length is **fixed at export time**. For longer inputs, chunk the
45
+ waveform or re-export with a larger `--max-duration`. A 10-second variant is
46
+ provided in a separate repository.
47
+
48
+ ## Files
49
+
50
+ | File | Size | Description |
51
+ |---|---|---|
52
+ | `omnilingual-ctc-300m-int8.mlpackage/` | ~312 MB | MLProgram with INT8-palettized weights |
53
+ | `tokenizer.model` | 1.2 MB | SentencePiece tokenizer (unk=3, pad=1, eos=2, bos=0) |
54
+ | `config.json` | <1 KB | Architecture + deployment metadata |
55
+
56
+ ## Inference
57
+
58
+ ```swift
59
+ import CoreML
60
+
61
+ let model = try MLModel(contentsOf: URL(fileURLWithPath: ".../omnilingual-ctc-300m-int8.mlpackage"))
62
+ let audio = MLMultiArray(shape: [1, 80000], dataType: .float32) // 5s @ 16kHz
63
+ // fill audio from zero-mean unit-var waveform ...
64
+ let input = try MLDictionaryFeatureProvider(dictionary: ["audio": audio])
65
+ let out = try model.prediction(from: input)
66
+ let logits = out.featureValue(for: "logits")!.multiArrayValue! // [1, 250, 10288]
67
+ // argmax over -1, collapse consecutive duplicates, drop blank, detokenize.
68
+ ```
69
+
70
+ Full Swift inference, CTC decoding, and multi-language routing are implemented in
71
+ [speech-swift](https://github.com/soniqo/speech-swift) under `Sources/OmnilingualASR/`.
72
+
73
+ ## Architecture
74
+
75
+ ```
76
+ Raw audio [1, samples]
77
+ β†’ Wav2Vec2FeatureExtractor (7-layer 1D conv, stride 320Γ—)
78
+ β†’ Linear 512 β†’ 1024
79
+ β†’ Wav2Vec2PositionEncoder (weight-normalized conv, kernel 128, groups 16)
80
+ β†’ 24 Γ— StandardTransformerEncoderLayer (pre-norm, dim 1024, heads 16, ffn 4096)
81
+ β†’ LayerNorm
82
+ β†’ Linear 1024 β†’ 10288 (CTC head)
83
+ β†’ logits
84
+ ```
85
+
86
+ Export pipeline: `torch.jit.trace` with a fixed-length sample input (fairseq2
87
+ `BatchLayout` is constructed inside a wrapper so the tracer only sees plain
88
+ tensors), followed by `coremltools.convert` at FP16 compute precision and
89
+ `OpPalettizerConfig(mode="kmeans", nbits=8)` weight palettization.
90
+
91
+ ## Performance
92
+
93
+ FLEURS test set, CTC-300M fp32 on CPU (Apple M-series), 30 utterances/language:
94
+
95
+ | Language | WER | Audio | RTF (CPU fp32 reference) |
96
+ |---|---|---|---|
97
+ | English (en_us) | 20.0% | 289 s | 0.056 |
98
+ | French (fr_fr) | 23.2% | 334 s | 0.059 |
99
+ | German (de_de) | 16.5% | 361 s | 0.058 |
100
+ | Arabic (ar_eg) | 19.5% | 331 s | 0.051 |
101
+ | Hindi (hi_in) | 22.5% | 364 s | 0.050 |
102
+
103
+ Expect ANE inference to reach RTF < 0.03 after palettization (wav2vec2
104
+ attention and ffn map cleanly onto the Neural Engine; only the 1D conv
105
+ frontend falls back to CPU/GPU). INT8 palettization typically adds < 1%
106
+ absolute WER on wav2vec2-class models.
107
+
108
+ ## Source
109
+
110
+ - Upstream model: [facebook/omniASR-CTC-300M](https://huggingface.co/facebook/omniASR-CTC-300M)
111
+ - Paper: [*Omnilingual ASR: Open-Source Multilingual Speech Recognition for 1600+ Languages*](https://arxiv.org/abs/2511.09690)
112
+ - Meta blog: [Omnilingual ASR announcement](https://ai.meta.com/blog/omnilingual-asr-advancing-automatic-speech-recognition/)
113
+
114
+ ## Links
115
+
116
+ - [speech-swift](https://github.com/soniqo/speech-swift) β€” Apple SDK
117
+ - [soniqo.audio](https://soniqo.audio) β€” website
118
+ - [blog](https://soniqo.audio/blog)
119
+
120
+ ## License
121
+
122
+ Apache 2.0 (inherited from upstream).
config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "omnilingual_asr_ctc",
3
+ "format": "coreml",
4
+ "quantization": "palettize-int8",
5
+ "sample_rate": 16000,
6
+ "frame_rate": 50,
7
+ "max_audio_seconds": 5.0,
8
+ "input_samples": 80000,
9
+ "encoder": {
10
+ "num_layers": 24,
11
+ "model_dim": 1024,
12
+ "num_heads": 16
13
+ },
14
+ "ctc_head": {
15
+ "vocab_size": 10288
16
+ },
17
+ "tokenizer": {
18
+ "kind": "sentencepiece",
19
+ "file": "tokenizer.model",
20
+ "bos_idx": 0,
21
+ "pad_idx": 1,
22
+ "eos_idx": 2,
23
+ "unk_idx": 3
24
+ }
25
+ }
omnilingual-ctc-300m-int8.mlpackage/Data/com.apple.CoreML/model.mlmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:55c3d1d5b4fc2060e2cc190bf30b8c2ae4351ea258b4e0075c6f32d6782c6360
3
+ size 302472
omnilingual-ctc-300m-int8.mlpackage/Data/com.apple.CoreML/weights/weight.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9ef5cdd07892d33a8e04daab4ad4776f9dafec69b0310dc34c27cf955bb50136
3
+ size 326444192
omnilingual-ctc-300m-int8.mlpackage/Manifest.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fileFormatVersion": "1.0.0",
3
+ "itemInfoEntries": {
4
+ "2A451547-3E52-4BA9-A286-18E465059773": {
5
+ "author": "com.apple.CoreML",
6
+ "description": "CoreML Model Weights",
7
+ "name": "weights",
8
+ "path": "com.apple.CoreML/weights"
9
+ },
10
+ "5C612306-DE37-47AC-8DAA-B1A1CC7DE6B4": {
11
+ "author": "com.apple.CoreML",
12
+ "description": "CoreML Model Specification",
13
+ "name": "model.mlmodel",
14
+ "path": "com.apple.CoreML/model.mlmodel"
15
+ }
16
+ },
17
+ "rootModelIdentifier": "5C612306-DE37-47AC-8DAA-B1A1CC7DE6B4"
18
+ }
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8aa11a1092142ef472537476ef6e76541123e2f0d789b79f3ebd119008240b1e
3
+ size 91481