Views
No views yet
kenpath/svara-tts-v1. Linear-layer weights stored in int8 with vector-wise quantization, computed in bf16. No calibration dataset; no fine-tuning. Quality is near-lossless relative to the upstream model — listen-test a few reference prompts before production.| bf16 | int8 (this repo) | |
|---|---|---|
| VRAM | ~16 GB | ~8–10 GB |
| Throughput vs bf16 | 1.0× | ~0.7–1.0× (dequant-bound on Ampere/Ada) |
| Quality | baseline | near-lossless, occasional edge-case artifacts |
| Calibration data | n/a | not required (post-training weight-only quant) |
| GPU | int8 fit | Notes |
|---|---|---|
| A100 40/80 GB | ✅ very comfortable | bf16 likely better here — VRAM is free |
| A40 48 GB | ✅ very comfortable | bf16 likely better — VRAM is free |
| L4 24 GB | ✅ tight | best use case — fits with KV cache headroom |
| RTX 4090 24 GB | ✅ tight | best use case |
| T4 16 GB | ✅ | required to fit at all |
| RTX 3090 24 GB | ✅ | works |
transformers >= 4.45, accelerate, bitsandbytes >= 0.43, flash-attn (recommended).1import torch
2from transformers import AutoModel, AutoTokenizer, BitsAndBytesConfig
3
4bnb = BitsAndBytesConfig(load_in_8bit=True)
5
6model = AutoModel.from_pretrained(
7 "tidelganesh/svara-tts-v1-bnb-8bit",
8 trust_remote_code=True,
9 quantization_config=bnb,
10 device_map="cuda",
11 attn_implementation="flash_attention_2",
12)
13tokenizer = AutoTokenizer.from_pretrained(
14 "tidelganesh/svara-tts-v1-bnb-8bit",
15 trust_remote_code=True,
16)trust_remote_code=True is required because the upstream model ships custom modeling code in modeling_svara.py. The quantization_config is required — from_pretrained will not auto-detect int8 weights.1- model = AutoModel.from_pretrained("kenpath/svara-tts-v1", trust_remote_code=True)
2+ from transformers import BitsAndBytesConfig
3+ model = AutoModel.from_pretrained(
4+ "tidelganesh/svara-tts-v1-bnb-8bit",
5+ trust_remote_code=True,
6+ quantization_config=BitsAndBytesConfig(load_in_8bit=True),
7+ device_map="cuda",
8+ attn_implementation="flash_attention_2",
9+ )POST /v1/text-to-speech, 24 kHz PCM16 mono) is unchanged.1pip install -U "transformers>=4.45" accelerate bitsandbytes "huggingface_hub[cli]" hf_transfer
2pip install -U flash-attn --no-build-isolation
3export HF_HUB_ENABLE_HF_TRANSFER=1
4huggingface-cli login
5export HF_TOKEN=hf_xxx...
6
7python backend/quantize_and_push_svara_8bit.py # ~15–25 min on A40
8python backend/verify_svara_8bit.py # round-trip checkkenpath/svara-tts-v1 with BitsAndBytesConfig(load_in_8bit=True) and Flash-Attention 2.safe_serialization=True (safetensors) sharded at 2 GB.tokenizer / preprocessor / *.py files so trust_remote_code still works.model.push_to_hub + tokenizer.push_to_hub to this repo.LLM.int8()) has a known numerical edge case on Llama-3 hidden dims of 4096 with vector_dim=4096 — Svara's Llama-3.1-8B sits right on this boundary. Outlier features in the LM head can occasionally cause audible artifacts on long or rare-token Tamil/English inputs.tidelganesh/svara-tts-v1-bf16) if you observe:
kenpath/svara-tts-v1 updates its modeling_svara.py, this repo must be re-pushed.kenpath/svara-tts-v1load_in_8bit=True + safetensors re-serializationtransformers, accelerate, bitsandbytes, huggingface_hub, flash-attntidelganesh/svara-tts-v1-bf16 — bf16 cast (lossless, ~16 GB VRAM). Recommended default when VRAM is not the bottleneck.kenpath/svara-tts-v1 — upstream fp32/fp16 checkpoint.kenpath/svara-tts-v1 for terms.