ONNX set runs on its own: front-end tensors in onnx/frontend.safetensors (208 KB); card: samples link, download lines per set
Browse filesFiles changed (4)
32 unmodified lines33343536373839404142434414 unmodified lines596061626364655 unmodified lines717273747576772 unmodified lines808182838485862 unmodified lines8990919293949525 unmodified lines1211221231241251261271281299 unmodified lines1391401411421431441457 unmodified lines15315415515615715815916016116216332 unmodified lines# IndiCodec-LiteA distilled, lightweight version of [IndiCodec](https://huggingface.co/prakharkhatri/IndiCodec): the same 1.09 kbpsspeech codec and the same tokens in **58 M parameters (75 MB in INT8)**, small enough for CPUs and phones.## Key features- **Same tokens as IndiCodec v1.0.** Content stream (25 Hz) + acoustic stream (50 Hz), the same FSQ grids. A speech LMor TTS trained on IndiCodec tokens decodes with IndiCodec-Lite, and the other way round.- **11x smaller:** 58 M parameters vs 624 M. 75 MB as INT8 ONNX, 232 MB in fp32.- **Runs without a GPU:** PyTorch on GPU or CPU, or ONNX Runtime (numpy + onnxruntime, no PyTorch). On ARM (phones,14 unmodified lines| Files | `model.safetensors` (fp32, PyTorch); `onnx/` INT8 set (75 MB) and fp32 set (233 MB) || Licence | Apache 2.0 |All three networks were distilled from IndiCodec v1.0 against its frozen quantizers: the content encoder (a 6 x 384Conformer initialised from w2v-BERT 2.0) to reproduce its content ids, with noise added to the input; the acousticencoder (a CNN) to reproduce its acoustic features; and the decoder (8 x 384 transformer, ISTFT head) to reproduce itsaudio from the same ids.5 unmodified linesPESQ-WB (higher is better):| Test set | IndiCodec-Lite<br>1.09 kbps | IndiCodec v1.0<br>1.09 kbps | Mimi, 8 codebooks<br>1.10 kbps | SNAC 24 kHz<br>0.98 kbps | NeuCodec<br>0.80 kbps ||---|---|---|---|---|---|| LibriTTS-R test (English) | 2.35 | **2.41** | 2.32 | 2.29 | 2.19 || CMU-Arctic (English) | 2.27 | **2.30** | 2.28 | 2.17 | 2.06 |2 unmodified linesIntelligibility and voice (higher is better):| | IndiCodec-Lite | IndiCodec v1.0 | Mimi | SNAC | NeuCodec ||---|---|---|---|---|---|| ESTOI, CMU-Arctic (English) | 0.850 | **0.855** | 0.848 | 0.835 | 0.824 || ESTOI, Seed-TTS eval (English) | 0.782 | 0.786 | **0.794** | 0.762 | 0.758 |2 unmodified linesWords after a round trip (lower is better):| | IndiCodec-Lite | IndiCodec v1.0 | Mimi | SNAC | NeuCodec ||---|---|---|---|---|---|| English WER, Seed-TTS eval | 3.1 % | **2.5 %** | 3.6 % | 4.9 % | 3.5 % || English WER, CMU-Arctic | 2.4 % | **2.3 %** | 3.2 % | 3.8 % | 2.8 % |25 unmodified linesaudio = codec.decode(content, acoustic) # 24 kHz```ONNX Runtime (CPUs and phones, no PyTorch):```bashpip install numpy scipy soundfile safetensors "onnxruntime>=1.18"```9 unmodified linesthe ids. On GPUs, use the PyTorch weights, or `onnxruntime-gpu` with `providers=["CUDAExecutionProvider"]` and`precision="fp32"`.The Lite encoders write the same token space as IndiCodec v1.0 but not identical ids (about a third of the frames matchexactly; the rest are neighbouring values). Ids from either codec decode with the other; for training a model, encodethe whole corpus with one of them.7 unmodified lines- Speech only; not for music.- Not streaming: the encoders and the decoder attend over the whole clip.- Words: about +0.6 points English WER and +0.5 points Indian-language CER over IndiCodec v1.0 (tables above).## LicenceApache 2.0. Distilled from IndiCodec v1.0 (Apache 2.0), which is built on[NeuCodec](https://huggingface.co/neuphonic/neucodec) (Apache 2.0); the decoder classes load from `neucodec`. Thecontent encoder was initialised from [w2v-BERT 2.0](https://huggingface.co/facebook/w2v-bert-2.0) (MIT; licence text in`indicodec_lite/w2v_bert/LICENSE`).32 unmodified lines333435363738394041424344454614 unmodified lines616263646566675 unmodified lines737475767778792 unmodified lines828384858687882 unmodified lines9192939495969725 unmodified lines1231241251261271281291301311321331349 unmodified lines1441451461471481491507 unmodified lines15815916016116216316416516616716832 unmodified lines# IndiCodec-Lite[Audio samples](https://codeprakhar25.github.io/IndiCodec/#samples)A distilled, lightweight version of [IndiCodec](https://huggingface.co/prakharkhatri/IndiCodec): the same 1.09 kbpsspeech codec and the same tokens in **58 M parameters (75 MB in INT8)**, small enough for CPUs and phones.## Key features- **Same tokens as IndiCodec.** Content stream (25 Hz) + acoustic stream (50 Hz), the same FSQ grids. A speech LMor TTS trained on IndiCodec tokens decodes with IndiCodec-Lite, and the other way round.- **11x smaller:** 58 M parameters vs 624 M. 75 MB as INT8 ONNX, 232 MB in fp32.- **Runs without a GPU:** PyTorch on GPU or CPU, or ONNX Runtime (numpy + onnxruntime, no PyTorch). On ARM (phones,14 unmodified lines| Files | `model.safetensors` (fp32, PyTorch); `onnx/` INT8 set (75 MB) and fp32 set (233 MB) || Licence | Apache 2.0 |All three networks were distilled from IndiCodec against its frozen quantizers: the content encoder (a 6 x 384Conformer initialised from w2v-BERT 2.0) to reproduce its content ids, with noise added to the input; the acousticencoder (a CNN) to reproduce its acoustic features; and the decoder (8 x 384 transformer, ISTFT head) to reproduce itsaudio from the same ids.5 unmodified linesPESQ-WB (higher is better):| Test set | IndiCodec-Lite<br>1.09 kbps | IndiCodec<br>1.09 kbps | Mimi, 8 codebooks<br>1.10 kbps | SNAC 24 kHz<br>0.98 kbps | NeuCodec<br>0.80 kbps ||---|---|---|---|---|---|| LibriTTS-R test (English) | 2.35 | **2.41** | 2.32 | 2.29 | 2.19 || CMU-Arctic (English) | 2.27 | **2.30** | 2.28 | 2.17 | 2.06 |2 unmodified linesIntelligibility and voice (higher is better):| | IndiCodec-Lite | IndiCodec | Mimi | SNAC | NeuCodec ||---|---|---|---|---|---|| ESTOI, CMU-Arctic (English) | 0.850 | **0.855** | 0.848 | 0.835 | 0.824 || ESTOI, Seed-TTS eval (English) | 0.782 | 0.786 | **0.794** | 0.762 | 0.758 |2 unmodified linesWords after a round trip (lower is better):| | IndiCodec-Lite | IndiCodec | Mimi | SNAC | NeuCodec ||---|---|---|---|---|---|| English WER, Seed-TTS eval | 3.1 % | **2.5 %** | 3.6 % | 4.9 % | 3.5 % || English WER, CMU-Arctic | 2.4 % | **2.3 %** | 3.2 % | 3.8 % | 2.8 % |25 unmodified linesaudio = codec.decode(content, acoustic) # 24 kHz```ONNX Runtime (CPUs and phones, no PyTorch). The full download above works; to fetch only the INT8 set (75 MB, for ARM:phones, Apple silicon), or only the fp32 set (233 MB, for x86):```bashhf download prakharkhatri/IndiCodec-Lite --include "indicodec_lite/*" "onnx/frontend.safetensors" "onnx/sem_int8.onnx" "onnx/ac_fp16.onnx" "onnx/dec_int8.onnx" --local-dir IndiCodec-Litehf download prakharkhatri/IndiCodec-Lite --include "indicodec_lite/*" "onnx/frontend.safetensors" "onnx/*_fp32.onnx" --local-dir IndiCodec-Litepip install numpy scipy soundfile safetensors "onnxruntime>=1.18"```9 unmodified linesthe ids. On GPUs, use the PyTorch weights, or `onnxruntime-gpu` with `providers=["CUDAExecutionProvider"]` and`precision="fp32"`.The Lite encoders write the same token space as IndiCodec but not identical ids (about a third of the frames matchexactly; the rest are neighbouring values). Ids from either codec decode with the other; for training a model, encodethe whole corpus with one of them.7 unmodified lines- Speech only; not for music.- Not streaming: the encoders and the decoder attend over the whole clip.- Words: about +0.6 points English WER and +0.5 points Indian-language CER over IndiCodec (tables above).## LicenceApache 2.0. Distilled from IndiCodec (Apache 2.0), which is built on[NeuCodec](https://huggingface.co/neuphonic/neucodec) (Apache 2.0); the decoder classes load from `neucodec`. Thecontent encoder was initialised from [w2v-BERT 2.0](https://huggingface.co/facebook/w2v-bert-2.0) (MIT; licence text in`indicodec_lite/w2v_bert/LICENSE`).
82 unmodified lines8384858687888917 unmodified lines10710810911011182 unmodified lines"onnx/dec_int8.onnx": "578a314cb9bf46b277bc578165c958c2","onnx/sem_fp32.onnx": "ccbcbed18c00545c55b8586753d3a8f8","onnx/ac_fp32.onnx": "4ddbd45401e3e6ed0e4b5294f4b0c934","onnx/dec_fp32.onnx": "26c17950d49bada4f5e55eb16c5d0aeb"},"sources": {"semantic_encoder": [17 unmodified lines"semantic_encoder": "137e03da48225d1e8679435268757eeb","acoustic_encoder": "e19050964703a015bf543f30196b7ed9","decoder": "25123ca2cb01a43c1101534757d04cbb"}}82 unmodified lines838485868788899017 unmodified lines10810911011111211382 unmodified lines"onnx/dec_int8.onnx": "578a314cb9bf46b277bc578165c958c2","onnx/sem_fp32.onnx": "ccbcbed18c00545c55b8586753d3a8f8","onnx/ac_fp32.onnx": "4ddbd45401e3e6ed0e4b5294f4b0c934","onnx/dec_fp32.onnx": "26c17950d49bada4f5e55eb16c5d0aeb","onnx/frontend.safetensors": "f1e5f588846dd37762525f3e8cface9c"},"sources": {"semantic_encoder": [17 unmodified lines"semantic_encoder": "137e03da48225d1e8679435268757eeb","acoustic_encoder": "e19050964703a015bf543f30196b7ed9","decoder": "25123ca2cb01a43c1101534757d04cbb"},"onnx_frontend": "onnx/frontend.safetensors"}
160 unmodified lines16116216316416516616713 unmodified lines181182183184185186187188189190191192193160 unmodified linesclass IndiCodecLiteONNX:"""ONNX Runtime path: onnx/ files; front end + FSQ in numpy (their weights read from model.safetensors)."""def __init__(self, sessions: dict, w: dict, precision: str):self.s, self.precision, self.spec = sessions, precision, _SPEC13 unmodified linesroot = Path(root)precision = default_precision() if precision == "auto" else precisionfiles = _SPEC["onnx"][precision]if check_md5:for k in ("model.safetensors", *files.values()):want = _SPEC["model_md5"] if k == "model.safetensors" else _SPEC["onnx_md5"][k]if md5_file(root / k) != want:raise SystemExit(f"{k}: md5 mismatch (re-download the repo)")keep = ("mel", "win", "fsq_s.", "fsq_a.")w = {k: v for k, v in load_file(str(root / "model.safetensors")).items() if k.startswith(keep)}so = ort.SessionOptions()so.intra_op_num_threads, so.inter_op_num_threads = threads, 1prov = providers or ["CPUExecutionProvider"]160 unmodified lines16116216316416516616716813 unmodified lines182183184185186187188189190191192193194195196160 unmodified linesclass IndiCodecLiteONNX:"""ONNX Runtime path: onnx/ files; front end + FSQ in numpy (their small weights from onnx/frontend.safetensors,or from model.safetensors when that file is absent)."""def __init__(self, sessions: dict, w: dict, precision: str):self.s, self.precision, self.spec = sessions, precision, _SPEC13 unmodified linesroot = Path(root)precision = default_precision() if precision == "auto" else precisionfiles = _SPEC["onnx"][precision]front = _SPEC.get("onnx_frontend", "onnx/frontend.safetensors")src = front if (root / front).exists() else "model.safetensors" # the ONNX set alone needs no model.safetensorsif check_md5:for k in (src, *files.values()):want = _SPEC["model_md5"] if k == "model.safetensors" else _SPEC["onnx_md5"][k]if md5_file(root / k) != want:raise SystemExit(f"{k}: md5 mismatch (re-download the repo)")keep = ("mel", "win", "fsq_s.", "fsq_a.")w = {k: v for k, v in load_file(str(root / src)).items() if k.startswith(keep)}so = ort.SessionOptions()so.intra_op_num_threads, so.inter_op_num_threads = threads, 1prov = providers or ["CPUExecutionProvider"]
123version https://git-lfs.github.com/spec/v1oid sha256:7c69c8b2b343878dae1744a3485072903a423708b7f1802a7f179dd42c86191asize 207600README.md+14-9
indicodec_lite/codec_spec.json+4-2
indicodec_lite/infer.py+6-3
onnx/frontend.safetensorsAdded+3