Instructions to use SDLC-Corp/TTS with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SDLC-Corp/TTS with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="SDLC-Corp/TTS")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("SDLC-Corp/TTS", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Professional model card: overview, usage, specs, intended use, limitations, ethics
Browse files
README.md
CHANGED
|
@@ -12,6 +12,7 @@ tags:
|
|
| 12 |
- vits
|
| 13 |
- mms
|
| 14 |
- multilingual
|
|
|
|
| 15 |
- english
|
| 16 |
- hindi
|
| 17 |
- marathi
|
|
@@ -21,219 +22,278 @@ base_model:
|
|
| 21 |
- facebook/mms-tts-mar
|
| 22 |
---
|
| 23 |
|
| 24 |
-
|
| 25 |
|
| 26 |
-
|
| 27 |
-
Each language is a separate VITS checkpoint from Meta AI's
|
| 28 |
-
[Massively Multilingual Speech (MMS)](https://arxiv.org/abs/2305.13516) project. You pick the
|
| 29 |
-
language with `subfolder=` and get 16 kHz speech from plain text, on a CPU or a GPU.
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
|
| 36 |
-
- [Quick start](#quick-start)
|
| 37 |
-
- [Using all three languages](#using-all-three-languages)
|
| 38 |
-
- [Options](#options)
|
| 39 |
-
- [Hardware and speed](#hardware-and-speed)
|
| 40 |
-
- [Model details](#model-details)
|
| 41 |
-
- [Intended use and limitations](#intended-use-and-limitations)
|
| 42 |
-
- [Demo app](#demo-app)
|
| 43 |
-
- [License](#license)
|
| 44 |
-
- [Citation](#citation)
|
| 45 |
|
| 46 |
-
|
| 47 |
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|---|---|---|---|---|
|
| 50 |
-
| English | `eng` | Latin
|
| 51 |
-
| Hindi | `hin` | Devanagari | 72
|
| 52 |
-
| Marathi | `mar` | Devanagari | 73
|
| 53 |
|
| 54 |
-
|
| 55 |
-
about 36M parameters, one built-in voice, 16 kHz mono output. The weights are identical to Meta's
|
| 56 |
-
originals.
|
| 57 |
|
| 58 |
```
|
| 59 |
-
|
| 60 |
-
├──
|
| 61 |
-
├── model.safetensors
|
| 62 |
-
├──
|
| 63 |
-
├──
|
| 64 |
-
└──
|
| 65 |
```
|
| 66 |
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
-
|
| 70 |
|
| 71 |
```bash
|
| 72 |
pip install torch transformers soundfile
|
| 73 |
```
|
| 74 |
|
| 75 |
-
Generate a WAV file:
|
| 76 |
-
|
| 77 |
```python
|
| 78 |
import torch
|
| 79 |
import soundfile as sf
|
| 80 |
from transformers import AutoTokenizer, VitsModel
|
| 81 |
|
| 82 |
-
repo = "SDLC-Corp/TTS"
|
| 83 |
-
lang = "hin" # "eng", "hin" or "mar"
|
| 84 |
|
| 85 |
tokenizer = AutoTokenizer.from_pretrained(repo, subfolder=lang)
|
| 86 |
model = VitsModel.from_pretrained(repo, subfolder=lang).eval()
|
| 87 |
|
| 88 |
inputs = tokenizer("नमस्ते, आप कैसे हैं?", return_tensors="pt")
|
| 89 |
|
| 90 |
-
torch.manual_seed(0) #
|
| 91 |
with torch.inference_mode():
|
| 92 |
waveform = model(**inputs).waveform[0].numpy()
|
| 93 |
|
| 94 |
-
sf.write("
|
| 95 |
```
|
| 96 |
|
| 97 |
-
|
| 98 |
-
the local Hugging Face cache.
|
| 99 |
|
| 100 |
-
|
| 101 |
|
| 102 |
```python
|
| 103 |
-
|
| 104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
```
|
| 106 |
|
| 107 |
-
##
|
| 108 |
|
| 109 |
-
A
|
|
|
|
| 110 |
|
| 111 |
```python
|
| 112 |
import torch
|
| 113 |
-
import soundfile as sf
|
| 114 |
from transformers import AutoTokenizer, VitsModel
|
| 115 |
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
```
|
| 146 |
|
| 147 |
-
##
|
| 148 |
|
| 149 |
-
|
| 150 |
|
| 151 |
-
|
|
| 152 |
|---|---|---|
|
| 153 |
-
| `model.speaking_rate` | `1.0` | Values above 1
|
| 154 |
-
| `model.noise_scale` | `0.667` |
|
| 155 |
-
| `model.noise_scale_duration` | `0.8` | Variation in
|
| 156 |
|
| 157 |
```python
|
| 158 |
-
model.speaking_rate = 0.9
|
|
|
|
| 159 |
```
|
| 160 |
|
| 161 |
-
|
| 162 |
-
|
| 163 |
|
| 164 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
and inputs to `"cuda"` as in the helper above.
|
| 169 |
-
- **Memory:** about 150 MB of RAM per loaded language.
|
| 170 |
|
| 171 |
-
##
|
| 172 |
|
| 173 |
-
| | |
|
| 174 |
|---|---|
|
| 175 |
-
| Architecture | VITS:
|
| 176 |
-
| Text encoder | 6 transformer layers
|
| 177 |
-
|
|
| 178 |
| Parameters | ~36M per language |
|
| 179 |
-
|
|
| 180 |
-
| Tokenizer | `VitsTokenizer`, character-level
|
| 181 |
-
| Speakers |
|
| 182 |
-
|
|
| 183 |
-
|
|
|
|
|
| 184 |
| Packaged by | [SDLC Corp](https://huggingface.co/SDLC-Corp) |
|
| 185 |
|
| 186 |
-
## Intended
|
| 187 |
|
| 188 |
-
**
|
| 189 |
-
non-commercial demos that need simple, lightweight speech in English, Hindi or Marathi.
|
| 190 |
|
| 191 |
-
|
|
|
|
|
|
|
|
|
|
| 192 |
|
| 193 |
-
|
| 194 |
-
- **Script must match the model.** Hindi and Marathi expect Devanagari. Latin text sent to them
|
| 195 |
-
(or Devanagari sent to English) is dropped by the tokenizer and can produce empty input; check
|
| 196 |
-
that `input_ids` is not empty, as the helper above does.
|
| 197 |
-
- **Numbers and abbreviations are not expanded.** Write them out ("twenty five", "पच्चीस") for
|
| 198 |
-
correct pronunciation.
|
| 199 |
-
- **No code-mixing.** Each model speaks one language. For Hinglish or mixed text, split it by
|
| 200 |
-
language and run each part through the matching model.
|
| 201 |
-
- **One plain voice per language.** No voice cloning, emotion or style control. The speech is
|
| 202 |
-
clear but less natural than large modern TTS systems.
|
| 203 |
-
- **Domain shift.** The training recordings are mostly read religious text, so casual or
|
| 204 |
-
technical sentences may sound less natural.
|
| 205 |
|
| 206 |
-
|
| 207 |
-
|
|
|
|
| 208 |
|
| 209 |
-
##
|
| 210 |
|
| 211 |
-
|
| 212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
|
| 214 |
```bash
|
| 215 |
git clone https://github.com/Sudhanshu619/TTS.git
|
| 216 |
cd TTS
|
| 217 |
pip install torch --index-url https://download.pytorch.org/whl/cpu # or a CUDA build
|
| 218 |
pip install -r requirements-demo.txt
|
| 219 |
-
python app.py
|
| 220 |
```
|
| 221 |
|
| 222 |
## License
|
| 223 |
|
| 224 |
-
The model weights are by **Meta AI** and
|
| 225 |
-
**[Creative Commons Attribution-NonCommercial 4.0 (CC
|
|
|
|
| 226 |
|
| 227 |
-
- **Non-commercial use only.**
|
| 228 |
for commercial purposes.
|
| 229 |
-
- **Attribution
|
| 230 |
-
- **
|
| 231 |
-
only the `safetensors` weights are
|
| 232 |
-
left out). The weights themselves are unchanged.
|
| 233 |
|
| 234 |
## Citation
|
| 235 |
|
| 236 |
-
If you use these models, please cite the MMS paper:
|
| 237 |
|
| 238 |
```bibtex
|
| 239 |
@article{pratap2023mms,
|
|
@@ -249,5 +309,13 @@ If you use these models, please cite the MMS paper:
|
|
| 249 |
|
| 250 |
## Acknowledgements
|
| 251 |
|
| 252 |
-
|
| 253 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
- vits
|
| 13 |
- mms
|
| 14 |
- multilingual
|
| 15 |
+
- indic
|
| 16 |
- english
|
| 17 |
- hindi
|
| 18 |
- marathi
|
|
|
|
| 22 |
- facebook/mms-tts-mar
|
| 23 |
---
|
| 24 |
|
| 25 |
+
<div align="center">
|
| 26 |
|
| 27 |
+
# SDLC Corp · Multilingual Text-to-Speech
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
+
**Lightweight, production-ready speech synthesis for English, Hindi and Marathi**
|
| 30 |
|
| 31 |
+
[](https://creativecommons.org/licenses/by-nc/4.0/)
|
| 32 |
+
[](#quick-start)
|
| 33 |
+
[](#supported-languages)
|
| 34 |
+
[](https://huggingface.co/docs/transformers/model_doc/vits)
|
| 35 |
+
[](#technical-specifications)
|
| 36 |
|
| 37 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
+

|
| 40 |
|
| 41 |
+
## Overview
|
| 42 |
+
|
| 43 |
+
This repository provides three end-to-end text-to-speech models (**English**, **Hindi** and
|
| 44 |
+
**Marathi**) under a single model ID. Each language is an independent VITS checkpoint from
|
| 45 |
+
Meta AI's [Massively Multilingual Speech (MMS)](https://arxiv.org/abs/2305.13516) project,
|
| 46 |
+
packaged by SDLC Corp for straightforward use with 🤗 Transformers.
|
| 47 |
+
|
| 48 |
+
**Highlights**
|
| 49 |
+
|
| 50 |
+
- **Three languages, one repository.** Select a language with `subfolder="eng" | "hin" | "mar"`.
|
| 51 |
+
- **End to end.** Text goes in and a waveform comes out, with no separate vocoder,
|
| 52 |
+
phonemizer or romanizer.
|
| 53 |
+
- **Lightweight.** About 36M parameters and 145 MB per language, fast enough for a CPU.
|
| 54 |
+
- **Native script input.** Hindi and Marathi take Devanagari text directly.
|
| 55 |
+
- **Drop-in.** Uses the standard `VitsModel` / `AutoTokenizer` APIs and the `text-to-speech`
|
| 56 |
+
pipeline.
|
| 57 |
+
|
| 58 |
+
## Table of Contents
|
| 59 |
+
|
| 60 |
+
1. [Supported Languages](#supported-languages)
|
| 61 |
+
2. [Quick Start](#quick-start)
|
| 62 |
+
3. [Usage](#usage)
|
| 63 |
+
4. [Generation Controls](#generation-controls)
|
| 64 |
+
5. [Performance and Hardware](#performance-and-hardware)
|
| 65 |
+
6. [Technical Specifications](#technical-specifications)
|
| 66 |
+
7. [Intended Use](#intended-use)
|
| 67 |
+
8. [Limitations](#limitations)
|
| 68 |
+
9. [Ethical Considerations](#ethical-considerations)
|
| 69 |
+
10. [Demo Application](#demo-application)
|
| 70 |
+
11. [License](#license)
|
| 71 |
+
12. [Citation](#citation)
|
| 72 |
+
|
| 73 |
+
## Supported Languages
|
| 74 |
+
|
| 75 |
+
| Language | Subfolder | Script | Vocabulary | Source checkpoint |
|
| 76 |
|---|---|---|---|---|
|
| 77 |
+
| English | `eng` | Latin (lowercased automatically) | 38 symbols | [facebook/mms-tts-eng](https://huggingface.co/facebook/mms-tts-eng) |
|
| 78 |
+
| Hindi (हिन्दी) | `hin` | Devanagari | 72 symbols | [facebook/mms-tts-hin](https://huggingface.co/facebook/mms-tts-hin) |
|
| 79 |
+
| Marathi (मराठी) | `mar` | Devanagari | 73 symbols | [facebook/mms-tts-mar](https://huggingface.co/facebook/mms-tts-mar) |
|
| 80 |
|
| 81 |
+
**Repository layout**
|
|
|
|
|
|
|
| 82 |
|
| 83 |
```
|
| 84 |
+
SDLC-Corp/TTS
|
| 85 |
+
├── eng/ ─┐
|
| 86 |
+
├── hin/ ├─ config.json · model.safetensors · tokenizer_config.json
|
| 87 |
+
├── mar/ ─┘ special_tokens_map.json · vocab.json
|
| 88 |
+
├── assets/
|
| 89 |
+
└── README.md
|
| 90 |
```
|
| 91 |
|
| 92 |
+
Only the requested subfolder is downloaded, so loading Hindi does not fetch the English or
|
| 93 |
+
Marathi weights.
|
| 94 |
+
|
| 95 |
+
## Quick Start
|
| 96 |
|
| 97 |
+
**Requirements:** Python 3.10+
|
| 98 |
|
| 99 |
```bash
|
| 100 |
pip install torch transformers soundfile
|
| 101 |
```
|
| 102 |
|
|
|
|
|
|
|
| 103 |
```python
|
| 104 |
import torch
|
| 105 |
import soundfile as sf
|
| 106 |
from transformers import AutoTokenizer, VitsModel
|
| 107 |
|
| 108 |
+
repo, lang = "SDLC-Corp/TTS", "hin" # lang: "eng", "hin" or "mar"
|
|
|
|
| 109 |
|
| 110 |
tokenizer = AutoTokenizer.from_pretrained(repo, subfolder=lang)
|
| 111 |
model = VitsModel.from_pretrained(repo, subfolder=lang).eval()
|
| 112 |
|
| 113 |
inputs = tokenizer("नमस्ते, आप कैसे हैं?", return_tensors="pt")
|
| 114 |
|
| 115 |
+
torch.manual_seed(0) # generation is stochastic; fix the seed for reproducible audio
|
| 116 |
with torch.inference_mode():
|
| 117 |
waveform = model(**inputs).waveform[0].numpy()
|
| 118 |
|
| 119 |
+
sf.write("output.wav", waveform, model.config.sampling_rate) # 16 kHz WAV
|
| 120 |
```
|
| 121 |
|
| 122 |
+
## Usage
|
|
|
|
| 123 |
|
| 124 |
+
### With the `text-to-speech` pipeline
|
| 125 |
|
| 126 |
```python
|
| 127 |
+
import soundfile as sf
|
| 128 |
+
from transformers import AutoTokenizer, VitsModel, pipeline
|
| 129 |
+
|
| 130 |
+
repo, lang = "SDLC-Corp/TTS", "eng"
|
| 131 |
+
tts = pipeline(
|
| 132 |
+
"text-to-speech",
|
| 133 |
+
model=VitsModel.from_pretrained(repo, subfolder=lang),
|
| 134 |
+
tokenizer=AutoTokenizer.from_pretrained(repo, subfolder=lang),
|
| 135 |
+
)
|
| 136 |
+
|
| 137 |
+
result = tts("Welcome to SDLC Corp.")
|
| 138 |
+
sf.write("welcome.wav", result["audio"].squeeze(), result["sampling_rate"])
|
| 139 |
```
|
| 140 |
|
| 141 |
+
### Serving all three languages
|
| 142 |
|
| 143 |
+
A minimal service class that loads each language on first use, caches it in memory and runs
|
| 144 |
+
on a GPU when one is available:
|
| 145 |
|
| 146 |
```python
|
| 147 |
import torch
|
|
|
|
| 148 |
from transformers import AutoTokenizer, VitsModel
|
| 149 |
|
| 150 |
+
|
| 151 |
+
class MultilingualTTS:
|
| 152 |
+
REPO = "SDLC-Corp/TTS"
|
| 153 |
+
LANGUAGES = {"english": "eng", "hindi": "hin", "marathi": "mar"}
|
| 154 |
+
|
| 155 |
+
def __init__(self, device: str | None = None):
|
| 156 |
+
self.device = device or ("cuda" if torch.cuda.is_available() else "cpu")
|
| 157 |
+
self._models: dict[str, tuple] = {}
|
| 158 |
+
|
| 159 |
+
def _load(self, code: str):
|
| 160 |
+
if code not in self._models:
|
| 161 |
+
tokenizer = AutoTokenizer.from_pretrained(self.REPO, subfolder=code)
|
| 162 |
+
model = VitsModel.from_pretrained(self.REPO, subfolder=code)
|
| 163 |
+
self._models[code] = (tokenizer, model.to(self.device).eval())
|
| 164 |
+
return self._models[code]
|
| 165 |
+
|
| 166 |
+
@torch.inference_mode()
|
| 167 |
+
def synthesize(self, text: str, language: str, seed: int = 0):
|
| 168 |
+
"""Return (waveform as float32 numpy array, sample_rate)."""
|
| 169 |
+
code = self.LANGUAGES.get(language.lower(), language)
|
| 170 |
+
tokenizer, model = self._load(code)
|
| 171 |
+
inputs = tokenizer(text, return_tensors="pt").to(self.device)
|
| 172 |
+
if inputs["input_ids"].shape[-1] == 0:
|
| 173 |
+
raise ValueError(f"Text contains no characters supported by the '{code}' model.")
|
| 174 |
+
torch.manual_seed(seed)
|
| 175 |
+
waveform = model(**inputs).waveform[0].cpu().numpy()
|
| 176 |
+
return waveform, model.config.sampling_rate
|
| 177 |
+
|
| 178 |
+
|
| 179 |
+
tts = MultilingualTTS()
|
| 180 |
+
audio, sr = tts.synthesize("नमस्कार, आपले स्वागत आहे.", "marathi")
|
| 181 |
+
```
|
| 182 |
+
|
| 183 |
+
### Playback in a notebook
|
| 184 |
+
|
| 185 |
+
```python
|
| 186 |
+
from IPython.display import Audio
|
| 187 |
+
Audio(audio, rate=sr)
|
| 188 |
```
|
| 189 |
|
| 190 |
+
## Generation Controls
|
| 191 |
|
| 192 |
+
The following attributes can be adjusted on a loaded model before generation:
|
| 193 |
|
| 194 |
+
| Attribute | Default | Description |
|
| 195 |
|---|---|---|
|
| 196 |
+
| `model.speaking_rate` | `1.0` | Speech tempo. Values above `1.0` are faster, below are slower. |
|
| 197 |
+
| `model.noise_scale` | `0.667` | Prosodic variation. Lower values give flatter, more consistent intonation. |
|
| 198 |
+
| `model.noise_scale_duration` | `0.8` | Variation in phoneme timing. |
|
| 199 |
|
| 200 |
```python
|
| 201 |
+
model.speaking_rate = 0.9 # slightly slower delivery
|
| 202 |
+
model.noise_scale = 0.5 # steadier intonation
|
| 203 |
```
|
| 204 |
|
| 205 |
+
VITS sampling is stochastic. Call `torch.manual_seed(...)` before each generation when you
|
| 206 |
+
need deterministic output.
|
| 207 |
|
| 208 |
+
## Performance and Hardware
|
| 209 |
+
|
| 210 |
+
| | CPU | GPU |
|
| 211 |
+
|---|---|---|
|
| 212 |
+
| Supported | Yes, out of the box | Yes, any CUDA-capable GPU |
|
| 213 |
+
| Memory per loaded language | ~150 MB RAM | < 1 GB VRAM |
|
| 214 |
+
| Typical latency (short sentence) | A few seconds on a laptop CPU | Well under a second |
|
| 215 |
|
| 216 |
+
A free Google Colab or Kaggle T4 GPU is more than sufficient. Each language is downloaded
|
| 217 |
+
once (~145 MB) and served from the local Hugging Face cache afterwards.
|
|
|
|
|
|
|
| 218 |
|
| 219 |
+
## Technical Specifications
|
| 220 |
|
| 221 |
+
| Property | Value |
|
| 222 |
|---|---|
|
| 223 |
+
| Architecture | [VITS](https://arxiv.org/abs/2106.06103): conditional VAE with adversarial training, normalizing-flow prior and stochastic duration predictor |
|
| 224 |
+
| Text encoder | 6 transformer layers · hidden size 192 · 2 attention heads · FFN 768 |
|
| 225 |
+
| Waveform decoder | HiFi-GAN-style generator, upsampling ×8 · ×8 · ×2 · ×2 |
|
| 226 |
| Parameters | ~36M per language |
|
| 227 |
+
| Weights format | `safetensors`, float32 |
|
| 228 |
+
| Tokenizer | `VitsTokenizer`, character-level, no phonemizer or uroman required |
|
| 229 |
+
| Speakers | Single speaker per language |
|
| 230 |
+
| Output | 16 kHz · mono · float32 waveform |
|
| 231 |
+
| Training data | MMS read-speech recordings (predominantly religious texts), per Pratap et al. (2023) |
|
| 232 |
+
| Original developer | Meta AI |
|
| 233 |
| Packaged by | [SDLC Corp](https://huggingface.co/SDLC-Corp) |
|
| 234 |
|
| 235 |
+
## Intended Use
|
| 236 |
|
| 237 |
+
**Suitable for**
|
|
|
|
| 238 |
|
| 239 |
+
- Research and education in speech synthesis and Indic-language technology
|
| 240 |
+
- Accessibility prototypes such as screen readers and read-aloud tools
|
| 241 |
+
- Internal demos, proofs of concept and non-commercial applications
|
| 242 |
+
- Lightweight on-device or CPU-only deployments
|
| 243 |
|
| 244 |
+
**Out of scope**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 245 |
|
| 246 |
+
- Commercial products or services (prohibited by the license)
|
| 247 |
+
- Voice cloning, speaker impersonation or expressive/emotional speech
|
| 248 |
+
- Languages other than English, Hindi and Marathi
|
| 249 |
|
| 250 |
+
## Limitations
|
| 251 |
|
| 252 |
+
- **Script must match the model.** Hindi and Marathi expect Devanagari, and English expects
|
| 253 |
+
Latin script. Unsupported characters are dropped by the tokenizer, which can result in
|
| 254 |
+
empty input. Validate that `input_ids` is non-empty, as shown in the service class above.
|
| 255 |
+
- **No text normalization.** Digits, dates, currency and abbreviations are not expanded.
|
| 256 |
+
Spell them out (for example "twenty-five" or "पच्चीस") for correct pronunciation.
|
| 257 |
+
- **No code-mixing.** Each model speaks one language. Segment mixed-language text (for
|
| 258 |
+
example Hinglish) and route each segment to the appropriate model.
|
| 259 |
+
- **Single voice.** There is one neutral voice per language, with no speaker or style selection.
|
| 260 |
+
- **Domain shift.** Training data is predominantly read religious text, so conversational or
|
| 261 |
+
technical content may sound less natural.
|
| 262 |
+
|
| 263 |
+
## Ethical Considerations
|
| 264 |
+
|
| 265 |
+
Synthetic speech can be misused. Do not use these models to impersonate real individuals,
|
| 266 |
+
to produce deceptive or fraudulent audio, or to present generated speech as a genuine
|
| 267 |
+
recording. Where generated audio is published, we recommend disclosing that it is synthetic.
|
| 268 |
+
|
| 269 |
+
## Demo Application
|
| 270 |
+
|
| 271 |
+
A Gradio web application built on these models is available on GitHub. It offers language
|
| 272 |
+
tabs, a character counter, an audio player, WAV download and automatic CPU/GPU detection.
|
| 273 |
|
| 274 |
```bash
|
| 275 |
git clone https://github.com/Sudhanshu619/TTS.git
|
| 276 |
cd TTS
|
| 277 |
pip install torch --index-url https://download.pytorch.org/whl/cpu # or a CUDA build
|
| 278 |
pip install -r requirements-demo.txt
|
| 279 |
+
python app.py # http://127.0.0.1:7860
|
| 280 |
```
|
| 281 |
|
| 282 |
## License
|
| 283 |
|
| 284 |
+
The model weights are developed by **Meta AI** and distributed under the
|
| 285 |
+
**[Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)](https://creativecommons.org/licenses/by-nc/4.0/)**
|
| 286 |
+
license.
|
| 287 |
|
| 288 |
+
- **Non-commercial use only.** The models, and audio generated with them, may not be used
|
| 289 |
for commercial purposes.
|
| 290 |
+
- **Attribution.** Credit Meta AI and the MMS authors, and reference the license.
|
| 291 |
+
- **Modifications.** The three original checkpoints are consolidated into one repository, and
|
| 292 |
+
only the `safetensors` weights are distributed. Model weights are unchanged.
|
|
|
|
| 293 |
|
| 294 |
## Citation
|
| 295 |
|
| 296 |
+
If you use these models in your work, please cite the original MMS paper:
|
| 297 |
|
| 298 |
```bibtex
|
| 299 |
@article{pratap2023mms,
|
|
|
|
| 309 |
|
| 310 |
## Acknowledgements
|
| 311 |
|
| 312 |
+
- [Meta AI, Massively Multilingual Speech](https://github.com/facebookresearch/fairseq/tree/main/examples/mms):
|
| 313 |
+
original models and research
|
| 314 |
+
- [🤗 Hugging Face Transformers](https://github.com/huggingface/transformers): VITS implementation and inference
|
| 315 |
+
- [Gradio](https://www.gradio.app/): demo application UI
|
| 316 |
+
|
| 317 |
+
<div align="center">
|
| 318 |
+
|
| 319 |
+
Maintained by **[SDLC Corp](https://huggingface.co/SDLC-Corp)**
|
| 320 |
+
|
| 321 |
+
</div>
|