File size: 3,539 Bytes
32942d4
 
 
 
 
 
 
01e140f
 
 
 
32942d4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
01e140f
 
 
 
32942d4
 
 
 
 
 
 
 
 
6119223
 
 
 
 
 
 
32942d4
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Shruti Core ML

A standalone port of every released language in Udgam Labs’ Apache-2.0 Shruti
speech model family. Each Core ML bundle is independent and uses the language’s
original released CQ4 weights and vocabulary. The status of the conversions and
the benchmark criteria are documented separately.

The first public experimental release contains all 22 model archives. The
published snapshot is pinned at `32942d41c1950cc7c439aa45688fb7d0dbd7913b`.
[Hugging Face release](https://huggingface.co/bingokingooo/shruti-coreml/tree/32942d41c1950cc7c439aa45688fb7d0dbd7913b)

## Reproduce

Use an Apple Silicon Mac with Xcode, Python 3.9 or compatible, and sufficient
disk space for model sources and compiled assets. The converter needs several
hundred megabytes per language.

```sh
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

git clone https://github.com/udgamlabs/shruti.git .upstream/shruti
git -C .upstream/shruti checkout 68a8d77e88e58ed1201cc20a9c4adc5d9750723f
python -m shruti_coreml.sources all
python -m shruti_coreml.batch all --jobs 2 --compile macos
python -m shruti_coreml.runtime build/hi example.wav --language hi
```

The checked catalog pins every source archive and metadata file. Core ML
normalizes acoustic features using their actual length. The encoder receives
zero-padded features with a valid-frame count. The decoder receives only the
valid cross-attention frames and runs batched beam search using the upstream
portable implementation. The released CQ4 weights are expanded into float32
graph constants. This expansion trades size for ease of verification. CPU
parity testing does not make a phone performance claim.

## Evaluate

```sh
export CACTUS_TELEMETRY=0
python -m shruti_coreml.fleurs hi_in
python -m shruti_coreml.benchmark hi \
  --manifest data/bench/fleurs/hi_in/test.jsonl --language hi \
  --output results/local/hi-fleurs
python -m shruti_coreml.monsoon
python -m shruti_coreml.benchmark hi \
  --manifest data/bench/monsoon/test.jsonl --language hi \
  --output results/local/hi-monsoon
python -m shruti_coreml.mucs
python -m shruti_coreml.benchmark hi \
  --manifest data/bench/mucs/test.jsonl --language hi \
  --output results/local/hi-mucs
python -m shruti_coreml.librispeech
python -m shruti_coreml.benchmark hi \
  --manifest data/bench/librispeech/test.jsonl --language en \
  --output results/local/hi-librispeech
python -m shruti_coreml.benchmark hi --silence --language hi \
  --output results/local/hi-silence
python -m unittest discover -s tests
```

See [evaluation protocol](docs/evaluation.md) for the distinctions between the
Hindi, 22-language and ONNX reports and how to supply paired transcripts.
Per-clip results stay local. Published benchmark files contain aggregates.

## Weight compression

See [Hindi compression experiments](docs/compression.md) for the candidate
profiles, reproduction commands, and evidence.
The [family screen](docs/family-compression.md) describes the paired
Indic DiarBench evaluation and how the release chooses a profile per language.

## Stage

```sh
python -m shruti_coreml.stage
```

The output directory `publish/` contains independent checksummed ZIPs with
portable Core ML packages, provenance, and original model notices. Compiled
macOS directories are excluded from these distribution bundles. Development
and publication are independent from the Koash app catalog.

[Udgam Labs Shruti](https://github.com/udgamlabs/shruti) ·
[Cactus Whistle](https://huggingface.co/Cactus-Compute/whistle)