# Notice This repository contains an ONNX re-export of `ai4bharat/indic-parler-tts`. ## Provenance - **Upstream model**: [`ai4bharat/indic-parler-tts`](https://huggingface.co/ai4bharat/indic-parler-tts) by AI4Bharat - **Upstream framework**: [`huggingface/parler-tts`](https://github.com/huggingface/parler-tts) by Yoach Lacombe, Vaibhav Srivastav, and Sanchit Gandhi - **License**: Apache 2.0 (preserved verbatim from upstream) ## What we did - Loaded the upstream Safetensors weights via `parler_tts.ParlerTTSForConditionalGeneration.from_pretrained`. - Forced `_attn_implementation = "eager"` on every nested config (text_encoder, decoder, audio_encoder) to make `torch.export.export` succeed — SDPA's data-dependent branching is incompatible with dynamo tracing. - Wrapped the text encoder, decoder (no-past), and decoder-with-past as three thin `nn.Module`s and exported each via `torch.onnx.export(..., dynamo=True, external_data=True)`. - Verified per-graph parity vs PyTorch eager forward (max abs diff `4.72e-6` for text encoder, `1.91e-5` for decoder step 1, `1.68e-4` for decoder step 2). No model surgery, no quantisation, no weight modification — these ONNX files run the same arithmetic as the upstream Safetensors model in float32. ## What we did NOT include - The DAC vocoder is bundled inside the upstream model as the `audio_encoder` submodule, but for the browser we consume [`onnx-community/dac_44khz-ONNX`](https://huggingface.co/onnx-community/dac_44khz-ONNX) separately. This avoids duplicate weights in the bundle. - The `apply_delay_pattern_mask` autoregressive helper is left out of the ONNX graph (it's stateful in a way that doesn't trace cleanly). Consumers port that ~30-line function to JS — see the upstream `parler_tts/modeling_parler_tts.py` for reference. ## Citation Please credit AI4Bharat and the Parler-TTS authors as described in the upstream model card.