Instructions to use Dubverse/MahaTTS with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Dubverse/MahaTTS with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="Dubverse/MahaTTS")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Dubverse/MahaTTS", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -19,127 +19,94 @@ library_name: transformers
|
|
| 19 |
---
|
| 20 |
<div align="center">
|
| 21 |
|
| 22 |
-
<
|
|
|
|
|
|
|
| 23 |
a <a href = "https://black.dubverse.ai">Dubverse Black</a> initiative <br> <br>
|
| 24 |
|
| 25 |
-
[](https://colab.research.google.com/drive/
|
| 26 |
-
[](https://discord.gg/4VGnrgpBN)
|
| 27 |
</div>
|
| 28 |
|
| 29 |
------
|
| 30 |
-
|
| 31 |
## Description
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
## Updates
|
| 40 |
|
| 41 |
-
|
| 42 |
|
| 43 |
-
-
|
| 44 |
-
- Community and access to new features on our [Discord](https://discord.gg/uFPrzBqyF2)
|
| 45 |
|
| 46 |
-
## Features
|
| 47 |
-
|
| 48 |
-
1. Multilinguality (coming soon)
|
| 49 |
-
2. Realistic Prosody and intonation
|
| 50 |
-
3. Multi-voice capabilities
|
| 51 |
-
|
| 52 |
-
## Installation
|
| 53 |
-
|
| 54 |
-
```bash
|
| 55 |
-
pip install git+https://github.com/dubverse-ai/MahaTTS.git
|
| 56 |
-
```
|
| 57 |
|
| 58 |
-
```bash
|
| 59 |
-
pip install maha-tts
|
| 60 |
-
```
|
| 61 |
|
| 62 |
-
## api usage
|
| 63 |
|
|
|
|
|
|
|
| 64 |
```bash
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
import torch,glob
|
| 68 |
-
from maha_tts import load_models,infer_tts
|
| 69 |
-
from scipy.io.wavfile import write
|
| 70 |
-
from IPython.display import Audio,display
|
| 71 |
-
|
| 72 |
-
# PATH TO THE SPEAKERS WAV FILES
|
| 73 |
-
speaker =['/content/infer_ref_wavs/2272_152282_000019_000001/',
|
| 74 |
-
'/content/infer_ref_wavs/2971_4275_000049_000000/',
|
| 75 |
-
'/content/infer_ref_wavs/4807_26852_000062_000000/',
|
| 76 |
-
'/content/infer_ref_wavs/6518_66470_000014_000002/']
|
| 77 |
-
|
| 78 |
-
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 79 |
-
diff_model,ts_model,vocoder,diffuser = load_models('Smolie',device)
|
| 80 |
-
print('Using:',device)
|
| 81 |
-
|
| 82 |
-
speaker_num = 0 # @param ["0", "1", "2", "3"] {type:"raw"}
|
| 83 |
-
text = "I freakin love how Elon came to life the moment they started talking about gaming and specifically diablo, you can tell that he didn't want that part of the discussion to end, while Lex to move on to the next subject! Once a true gamer, always a true gamer!" # @param {type:"string"}
|
| 84 |
-
|
| 85 |
-
ref_clips = glob.glob(speaker[speaker_num]+'*.wav')
|
| 86 |
-
audio,sr = infer_tts(text,ref_clips,diffuser,diff_model,ts_model,vocoder)
|
| 87 |
-
|
| 88 |
-
write('/content/test.wav',sr,audio)
|
| 89 |
-
```
|
| 90 |
-
## Roadmap
|
| 91 |
-
- [x] Smolie - eng (trained on 200 hours of LibriTTS)
|
| 92 |
-
- [ ] Smolie - indic (Train on Indian languages, coming soon)
|
| 93 |
-
- [ ] Optimizations for inference (looking for contributors, check issues)
|
| 94 |
-
|
| 95 |
-
## Some Generated Samples
|
| 96 |
-
0 -> "I seriously laughed so much hahahaha (seals with headphones...) and appreciate both the interviewer and the subject. Major respect for two extraordinary humans - and in this time of gratefulness, I'm thankful for you both and this forum!"
|
| 97 |
-
|
| 98 |
-
1 -> "I freakin love how Elon came to life the moment they started talking about gaming and specifically diablo, you can tell that he didn't want that part of the discussion to end, while Lex to move on to the next subject! Once a true gamer, always a true gamer!"
|
| 99 |
|
| 100 |
-
2 -> "hello there! how are you?" (This one didn't work well, M1 model hallucinated)
|
| 101 |
-
|
| 102 |
-
3 -> "Who doesn't love a good scary story, something to send a chill across your skin in the middle of summer's heat or really, any other time? And this year, we're celebrating the two hundredth birthday of one of the most famous scary stories of all time: Frankenstein."
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
https://github.com/dubverse-ai/MahaTTS/assets/32906806/462ee134-5d8c-43c8-a425-3b6cabd2ff85
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
https://github.com/dubverse-ai/MahaTTS/assets/32906806/40c62402-7f65-4a35-b739-d8b8a082ad62
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
https://github.com/dubverse-ai/MahaTTS/assets/32906806/f0a9628c-ef81-450d-ab82-2f4c4626864e
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
https://github.com/dubverse-ai/MahaTTS/assets/32906806/15476151-72ea-410d-bcdc-177433df7884
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
## Technical Details
|
| 123 |
|
| 124 |
### Model Params
|
| 125 |
-
| Model
|
| 126 |
|:-------------------------:|:----------:|------------|:-----------------:|
|
| 127 |
-
| Text to Semantic (M1) |
|
| 128 |
-
| Semantic to MelSpec(M2) |
|
| 129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
|
| 131 |
-
### Languages Supported
|
| 132 |
-
| Language | Status |
|
| 133 |
-
| --- | :---: |
|
| 134 |
-
| English (en) | β
|
|
| 135 |
|
| 136 |
## License
|
| 137 |
-
|
| 138 |
MahaTTS is licensed under the Apache 2.0 License.
|
| 139 |
|
| 140 |
## π Appreciation
|
| 141 |
|
| 142 |
-
- [
|
| 143 |
- [M4t Seamless](https://github.com/facebookresearch/seamless_communication) [AudioLM](https://arxiv.org/abs/2209.03143) and many other ground-breaking papers that enabled the development of MahaTTS
|
| 144 |
-
- [
|
|
|
|
| 145 |
- [Huggingface](https://huggingface.co/docs/transformers/index) for related training and inference code
|
|
|
|
| 19 |
---
|
| 20 |
<div align="center">
|
| 21 |
|
| 22 |
+
<a href="https://ibb.co/wN1LS7K"><img width="320" height="173" alt="Screenshot-2024-01-15-at-8-14-08-PM" src="https://github.com/user-attachments/assets/af22f00d-e9d6-49e1-98b1-7efeac900f9a" /></a>
|
| 23 |
+
|
| 24 |
+
<h1>MahaTTS v2: An Open-Source Large Speech Generation Model</h1>
|
| 25 |
a <a href = "https://black.dubverse.ai">Dubverse Black</a> initiative <br> <br>
|
| 26 |
|
| 27 |
+
<!-- [](https://colab.research.google.com/drive/1qkZz2km-PX75P0f6mUb2y5e-uzub27NW?usp=sharing) -->
|
|
|
|
| 28 |
</div>
|
| 29 |
|
| 30 |
------
|
|
|
|
| 31 |
## Description
|
| 32 |
+
We introduce MahaTTS v2, a multi-speaker text-to-speech (TTS) system that has been trained on 50k hours of Indic and global languages.
|
| 33 |
+
We have followed a text-to-semantic-to-acoustic approach, leveraging wav2vec2 tokens, this gives out-the-box generalization to unseen low-resourced languages.
|
| 34 |
+
We have open sourced the first version (MahaTTS), which was trained on English and Indic languages as two separate models on 9k and 400 hours of open source datasets.
|
| 35 |
+
In MahaTTS v2, we have collected over 20k+ hours of training data into a single multilingual cross-lingual model.
|
| 36 |
+
We have used gemma as the backbone for text-to-semantic modeling and a conditional flow model for semantics to mel spectogram generation, using a BigVGAN vocoder to generate the final audio waveform.
|
| 37 |
+
The model has shown great robustness and quality results compared to the previous version.
|
| 38 |
+
We are also open sourcing the ability to finetune on your own voice.
|
| 39 |
|
| 40 |
+
### With this release:
|
| 41 |
+
- generate voices in multiple seen and unseen speaker identities (voice cloning)
|
| 42 |
+
- generate voices in multiple langauges (multilingual and cross-lingual voice cloning)
|
| 43 |
+
- copy the style of speech from one speaker to another (cross-lingual voice cloning with prosody and intonation transfer)
|
| 44 |
+
- Train your own large scale pretraining or finetuning Models.
|
|
|
|
|
|
|
| 45 |
|
| 46 |
+
### MahaTTS Architecture
|
| 47 |
|
| 48 |
+
<img width="1023" height="859" alt="Screenshot 2025-07-10 at 4 04 08β―PM" src="https://github.com/user-attachments/assets/4d44cc35-4b66-41a1-b4fd-415af35eda87" />
|
|
|
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
|
|
|
|
|
|
|
|
|
| 51 |
|
|
|
|
| 52 |
|
| 53 |
+
<!-- ## Installation -->
|
| 54 |
+
<!--
|
| 55 |
```bash
|
| 56 |
+
pip install git+https://github.com/dubverse-ai/MahaTTSv2.git
|
| 57 |
+
``` -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
### Model Params
|
| 61 |
+
| Model | Parameters | Model Type | Output |
|
| 62 |
|:-------------------------:|:----------:|------------|:-----------------:|
|
| 63 |
+
| Text to Semantic (M1) | 510 M | Causal LM | 10,001 Tokens |
|
| 64 |
+
| Semantic to MelSpec(M2) | 71 M | FLOW | 100x Melspec |
|
| 65 |
+
| BigVGAN Vocoder | 112 M | GAN | Audio Waveform |
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
## π Supported Languages
|
| 69 |
+
|
| 70 |
+
The following languages are currently supported:
|
| 71 |
+
|
| 72 |
+
| Language | Status |
|
| 73 |
+
|------------------|:------:|
|
| 74 |
+
| Assamese (in) | β
|
|
| 75 |
+
| Bengali (in) | β
|
|
| 76 |
+
| Bhojpuri (in) | β
|
|
| 77 |
+
| Bodo (in) | β
|
|
| 78 |
+
| Dogri (in) | β
|
|
| 79 |
+
| Odia (in) | β
|
|
| 80 |
+
| English (en) | β
|
|
| 81 |
+
| French (fr) | β
|
|
| 82 |
+
| Gujarati (in) | β
|
|
| 83 |
+
| German (de) | β
|
|
| 84 |
+
| Hindi (in) | β
|
|
| 85 |
+
| Italian (it) | β
|
|
| 86 |
+
| Kannada (in) | β
|
|
| 87 |
+
| Malayalam (in) | β
|
|
| 88 |
+
| Marathi (in) | β
|
|
| 89 |
+
| Telugu (in) | β
|
|
| 90 |
+
| Punjabi (in) | β
|
|
| 91 |
+
| Rajasthani (in) | β
|
|
| 92 |
+
| Sanskrit (in) | β
|
|
| 93 |
+
| Spanish (es) | β
|
|
| 94 |
+
| Tamil (in) | β
|
|
| 95 |
+
| Telugu (in) | β
|
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
## TODO:
|
| 99 |
+
1. Addind Training Instructions.
|
| 100 |
+
2. Add a colab for the same.
|
| 101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
|
| 103 |
## License
|
|
|
|
| 104 |
MahaTTS is licensed under the Apache 2.0 License.
|
| 105 |
|
| 106 |
## π Appreciation
|
| 107 |
|
| 108 |
+
- [Tortoise-tts](https://github.com/neonbjb/tortoise-tts) for inspiring the architecture
|
| 109 |
- [M4t Seamless](https://github.com/facebookresearch/seamless_communication) [AudioLM](https://arxiv.org/abs/2209.03143) and many other ground-breaking papers that enabled the development of MahaTTS
|
| 110 |
+
- [BIGVGAN](https://github.com/NVIDIA/BigVGAN) out of the box vocoder
|
| 111 |
+
- [Flow training](https://github.com/shivammehta25/Matcha-TTS) for training Flow model
|
| 112 |
- [Huggingface](https://huggingface.co/docs/transformers/index) for related training and inference code
|