File size: 4,130 Bytes
eea07ad
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6b32149
526e405
 
 
eea07ad
 
 
 
00b1590
eea07ad
 
 
 
 
 
 
 
00b1590
eea07ad
 
 
 
 
 
 
00b1590
eea07ad
 
 
 
 
 
 
b0e6460
eea07ad
 
 
 
 
 
 
 
 
 
 
b0e6460
eea07ad
 
00b1590
eea07ad
712d0d6
2c69e80
 
 
 
 
 
 
 
 
 
 
 
 
 
712d0d6
00b1590
712d0d6
2c69e80
712d0d6
66b30d6
 
 
00b1590
178a3e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
00b1590
712d0d6
b49588c
eea07ad
 
 
 
 
 
 
2a91dc3
eea07ad
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
---
license: cc-by-4.0
language:
- as
- bn
- brx
- doi
- kn
- mai
- ml
- mr
- ne
- pa
- sa
- ta
- te
library_name: transformers
pipeline_tag: text-to-speech
tags:
- text-to-speech
---
# VITS TTS for Indian Languages

This repository contains a VITS-based Text-to-Speech (TTS) model fine-tuned for Indian languages. The model supports multiple Indian languages and a wide range of speaking styles and emotions, making it suitable for diverse use cases such as conversational AI, audiobooks, and more.

---

## Model Overview

The model `ai4bharat/vits_rasa_13` is based on the VITS architecture and supports the following features:
- **Languages**: Multiple Indian languages.
- **Styles**: Various speaking styles and emotions.
- **Speaker IDs**: Predefined speaker profiles for male and female voices.

---

## Installation

```bash
pip install transformers torch
```

---

## Usage

Here's a quick example to get started:

```python
import soundfile as sf
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("ai4bharat/vits_rasa_13", trust_remote_code=True).to("cuda")
tokenizer = AutoTokenizer.from_pretrained("ai4bharat/vits_rasa_13", trust_remote_code=True)

text = "ਕੀ ਮੈਂ ਇਸ ਹਫਤੇ ਦੇ ਅੰਤ ਵਿੱਚ ਰੁੱਝਿਆ ਹੋਇਆ ਹਾਂ?"  # Example text in Punjabi
speaker_id = 16  # PAN_M
style_id = 0  # ALEXA

inputs = tokenizer(text=text, return_tensors="pt").to("cuda")
outputs = model(inputs['input_ids'], speaker_id=speaker_id, emotion_id=style_id)
sf.write("audio.wav", outputs.waveform.squeeze(), model.config.sampling_rate)
print(outputs.waveform.shape)
```

---

## Supported Languages

- `Assamese` 
- `Bengali`   
- `Bodo`     
- `Dogri`      
- `Kannada`    
- `Maithili`   
- `Malayalam`  
- `Marathi`    
- `Nepali`     
- `Punjabi`    
- `Sanskrit`   
- `Tamil`      
- `Telugu`

---

## Speaker-Style Identifier Overview

<div style="display: flex; align-items: flex-start; gap: 20px; margin: 0; padding: 0;">

<table style="margin: 0; padding: 0; border-spacing: 0;">
  <tr>
    <th>Speaker Name</th>
    <th>Speaker ID</th>
  </tr>
  <tr>
    <td>ASM_F</td>
    <td>0</td>
  </tr>
  <tr>
    <td>ASM_M</td>
    <td>1</td>
  </tr>
  <tr>
    <td>BEN_F</td>
    <td>2</td>
  </tr>
  <tr>
    <td>BEN_M</td>
    <td>3</td>
  </tr>
  <tr>
    <td>BRX_F</td>
    <td>4</td>
  </tr>
  <tr>
    <td>BRX_M</td>
    <td>5</td>
  </tr>
  <tr>
    <td>DOI_F</td>
    <td>6</td>
  </tr>
  <tr>
    <td>DOI_M</td>
    <td>7</td>
  </tr>
  <tr>
    <td>KAN_F</td>
    <td>8</td>
  </tr>
  <tr>
    <td>KAN_M</td>
    <td>9</td>
  </tr>
  <tr>
    <td>MAI_M</td>
    <td>10</td>
  </tr>
  <tr>
    <td>MAL_F</td>
    <td>11</td>
  </tr>
  <tr>
    <td>MAR_F</td>
    <td>12</td>
  </tr>
  <tr>
    <td>MAR_M</td>
    <td>13</td>
  </tr>
  <tr>
    <td>NEP_F</td>
    <td>14</td>
  </tr>
  <tr>
    <td>PAN_F</td>
    <td>15</td>
  </tr>
  <tr>
    <td>PAN_M</td>
    <td>16</td>
  </tr>
  <tr>
    <td>SAN_M</td>
    <td>17</td>
  </tr>
  <tr>
    <td>TAM_F</td>
    <td>18</td>
  </tr>
  <tr>
    <td>TEL_F</td>
    <td>19</td>
  </tr>
</table>

<table>
  <tr>
    <th>Style Name</th>
    <th>Style ID</th>
  </tr>
  <tr>
    <td>ALEXA</td>
    <td>0</td>
  </tr>
  <tr>
    <td>ANGER</td>
    <td>1</td>
  </tr>
  <tr>
    <td>BB</td>
    <td>2</td>
  </tr>
  <tr>
    <td>BOOK</td>
    <td>3</td>
  </tr>
  <tr>
    <td>CONV</td>
    <td>4</td>
  </tr>
  <tr>
    <td>DIGI</td>
    <td>5</td>
  </tr>
  <tr>
    <td>DISGUST</td>
    <td>6</td>
  </tr>
  <tr>
    <td>FEAR</td>
    <td>7</td>
  </tr>
  <tr>
    <td>HAPPY</td>
    <td>8</td>
  </tr>
  <tr>
    <td>NEWS</td>
    <td>10</td>
  </tr>
  <tr>
    <td>SAD</td>
    <td>12</td>
  </tr>
  <tr>
    <td>SURPRISE</td>
    <td>14</td>
  </tr>
  <tr>
    <td>UMANG</td>
    <td>15</td>
  </tr>
  <tr>
    <td>WIKI</td>
    <td>16</td>
  </tr>
</table>

</div>

---

## Citation

If you use this model in your research, please cite:

```bibtex
@article{ai4bharat_vits_rasa_13,
  title={VITS TTS for Indian Languages},
  author={Ashwin Sankar},
  year={2024},
  publisher={Hugging Face}
}
```