Downloads · 30 days
9
12% of all-time downloads
tidelganesh/svara-tts-v1-bnb-8bit
svara-tts-v1-bnb-8bit is a text-to-speech model from tidelganesh. Use it when you need text read aloud. The card lists the license as mit.
bitsandbytes int8 weights re-quantization of 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…
Downloads · 30 days
9
12% of all-time downloads
All-time downloads
74
Public
Parameters
3.3B
3.8 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.8 GB · 99%
How the weights are stored.
I82.8B · 85%
From the Hugging Face model README
bitsandbytes int8 weights re-quantization of 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) |
int8 is the right choice when you want more concurrent streams per GPU or you're deploying to a smaller card. On a 24 GB GPU (L4, RTX 4090) int8 leaves room for long-context KV cache and 3–4 concurrent requests. On a 16 GB card (T4) int8 is required, bf16 will OOM.
| 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 |
Software: CUDA ≥ 11.8, PyTorch ≥ 2.3, transformers >= 4.45, accelerate, bitsandbytes >= 0.43, flash-attn (recommended).
import torch
from transformers import AutoModel, AutoTokenizer, BitsAndBytesConfig
bnb = BitsAndBytesConfig(load_in_8bit=True)
model = AutoModel.from_pretrained(
"tidelganesh/svara-tts-v1-bnb-8bit",
trust_remote_code=True,
quantization_config=bnb,
device_map="cuda",
attn_implementation="flash_attention_2",
)
tokenizer = AutoTokenizer.from_pretrained(
"tidelganesh/svara-tts-v1-bnb-8bit",
trust_remote_code=True,
)
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.
This repo is intended to back a self-hosted Svara-TTS FastAPI server. Point the server's model loader at this repo instead of the upstream one:
- model = AutoModel.from_pretrained("kenpath/svara-tts-v1", trust_remote_code=True)
+ from transformers import BitsAndBytesConfig
+ model = AutoModel.from_pretrained(
+ "tidelganesh/svara-tts-v1-bnb-8bit",
+ trust_remote_code=True,
+ quantization_config=BitsAndBytesConfig(load_in_8bit=True),
+ device_map="cuda",
+ attn_implementation="flash_attention_2",
+ )
Server contract (POST /v1/text-to-speech, 24 kHz PCM16 mono) is unchanged.
pip install -U "transformers>=4.45" accelerate bitsandbytes "huggingface_hub[cli]" hf_transfer
pip install -U flash-attn --no-build-isolation
export HF_HUB_ENABLE_HF_TRANSFER=1
huggingface-cli login
export HF_TOKEN=hf_xxx...
python backend/quantize_and_push_svara_8bit.py # ~15–25 min on A40
python backend/verify_svara_8bit.py # round-trip check
The script:
kenpath/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.Inherits the upstream license. Please refer to kenpath/svara-tts-v1 for terms.