Update README.md
Browse files
README.md
CHANGED
|
@@ -1,7 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
Model Type: Text to Speech
|
| 3 |
Supported Languages: Assamese, Bengali, Bodo, Gujarati, Hindi, Kannada, Malayalam, Manipuri, Marathi, Odia, Punjabi, Rajasthani, Tamil, Telugu, Urdu
|
| 4 |
---
|
|
|
|
| 5 |
***Demo: [IITM-TTS Demo](https://iitm-tts.onrender.com) | This may take approximately 30 seconds to load the first time and will go idle after 15 minutes of inactivity.***
|
| 6 |
|
| 7 |
# Fastspeech2_HS_Flask_API
|
|
@@ -38,126 +117,7 @@ git clone https://huggingface.co/k-m-irfan/Fastspeech2_HS_Flask_API
|
|
| 38 |
```
|
| 39 |
|
| 40 |
Alternatively, you can download the models from the original repository [Fastspeech2_HS](https://github.com/smtiitm/Fastspeech2_HS)
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
├── hindi
|
| 46 |
-
│ ├── female
|
| 47 |
-
│ └── male
|
| 48 |
-
├── tamil
|
| 49 |
-
│ ├── female
|
| 50 |
-
│ └── male
|
| 51 |
-
.
|
| 52 |
-
.
|
| 53 |
-
.
|
| 54 |
-
└── marathi
|
| 55 |
-
├── female
|
| 56 |
-
└── male
|
| 57 |
-
```
|
| 58 |
-
|
| 59 |
-
### Installation:
|
| 60 |
-
|
| 61 |
-
Create a virtual environment and activate it:
|
| 62 |
-
```bash
|
| 63 |
-
python3 -m venv tts-hs-hifigan
|
| 64 |
-
source tts-hs-hifigan/bin/activate
|
| 65 |
-
```
|
| 66 |
-
|
| 67 |
-
Install the required dependencies by running:
|
| 68 |
-
```bash
|
| 69 |
-
pip install -r requirements.txt
|
| 70 |
-
```
|
| 71 |
-
|
| 72 |
-
### Run Flask server:
|
| 73 |
-
Ensure the server application is running correctly before proceeding. Use the following commands and check for any errors:
|
| 74 |
-
```bash
|
| 75 |
-
python3 flask_app.py
|
| 76 |
-
# OR
|
| 77 |
-
gunicorn -w 2 -b 0.0.0.0:5000 flask_app:app --timeout 600
|
| 78 |
-
```
|
| 79 |
-
|
| 80 |
-
If the application is running without any issues, proceed to start the server using the following command:
|
| 81 |
-
```bash
|
| 82 |
-
bash start.sh
|
| 83 |
-
```
|
| 84 |
-
|
| 85 |
-
### API
|
| 86 |
-
```python
|
| 87 |
-
"""
|
| 88 |
-
This is a sample API code to send a text to the server and recieve speech
|
| 89 |
-
for the given text.
|
| 90 |
-
|
| 91 |
-
Supported languages:
|
| 92 |
-
|
| 93 |
-
Assamese, Bengali, Bodo, Gujarati, Hindi, Kannada, Malayalam, Manipuri
|
| 94 |
-
Marathi, Odia, Punjabi, Rajasthani, Tamil, Telugu, Urdu
|
| 95 |
-
|
| 96 |
-
"""
|
| 97 |
-
import requests
|
| 98 |
-
import json
|
| 99 |
-
import base64
|
| 100 |
-
|
| 101 |
-
# endpoint
|
| 102 |
-
url = "http://localhost:5000/tts"
|
| 103 |
-
|
| 104 |
-
lang = 'hindi'
|
| 105 |
-
gender = 'female'
|
| 106 |
-
text = "सुप्रभात, आप कैसे हैं?" # hindi
|
| 107 |
-
# text = "സുപ്രഭാതം, സുഖമാ?" # malayalam
|
| 108 |
-
# text = "সুপ্ৰভাত, তুমি কেনে?" # manipuri
|
| 109 |
-
# text = "सुप्रभात, तुम्ही कसे आहात?" # marathi
|
| 110 |
-
# text = "ಶುಭೋದಯ, ನೀವು ಹೇಗಿದ್ದೀರಿ?" # kannada
|
| 111 |
-
# text = "बसु म्विथ्बो, बरि दिबाबो?" # bodo male yet to be added <---
|
| 112 |
-
# text = "Good morning, how are you?" # english
|
| 113 |
-
# text = "সুপ্ৰভাত, আপুনি কেমন আছে?" # assamese
|
| 114 |
-
# text = "காலை வணக்கம், நீங்கள் எப்படி இருக்கின்றீர்கள்?" # tamil
|
| 115 |
-
# text = "ସୁପ୍ରଭାତ, ଆପଣ କେମିତି ଅଛନ୍ତି?"
|
| 116 |
-
# text = "सुप्रभात, आप कैसे छो?" # rajasthani
|
| 117 |
-
# text = "శుభోదయం, మీరు ఎలా ఉన్నారు?" # telugu
|
| 118 |
-
# text = "সুপ্রভাত, আপনি কেমন আছেন?" # bengali
|
| 119 |
-
# text = "સુપ્રભાત, તમે કેમ છો?" # gujarati
|
| 120 |
-
|
| 121 |
-
payload = json.dumps(
|
| 122 |
-
{
|
| 123 |
-
"input": text,
|
| 124 |
-
"gender": gender,
|
| 125 |
-
"lang": lang,
|
| 126 |
-
"alpha": 1 # to control speed
|
| 127 |
-
})
|
| 128 |
-
|
| 129 |
-
headers = {'Content-Type': 'application/json'}
|
| 130 |
-
response = requests.request("POST", url, headers=headers, data=payload).json()
|
| 131 |
-
|
| 132 |
-
# save the received encoded audio
|
| 133 |
-
audio = response['audio']
|
| 134 |
-
file_name = "tts.wav"
|
| 135 |
-
wav_file = open(file_name,'wb')
|
| 136 |
-
decode_string = base64.b64decode(audio)
|
| 137 |
-
wav_file.write(decode_string)
|
| 138 |
-
wav_file.close()
|
| 139 |
-
```
|
| 140 |
-
|
| 141 |
-
### Citation for the original repo
|
| 142 |
-
If you use this Fastspeech2 Model in your research or work, please consider citing:
|
| 143 |
-
|
| 144 |
-
“
|
| 145 |
-
COPYRIGHT
|
| 146 |
-
2023, Speech Technology Consortium,
|
| 147 |
-
Bhashini, MeiTY and by Hema A Murthy & S Umesh,
|
| 148 |
-
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
|
| 149 |
-
and
|
| 150 |
-
ELECTRICAL ENGINEERING,
|
| 151 |
-
IIT MADRAS. ALL RIGHTS RESERVED "
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
Shield: [![CC BY 4.0][cc-by-shield]][cc-by]
|
| 155 |
-
|
| 156 |
-
This work is licensed under a
|
| 157 |
-
[Creative Commons Attribution 4.0 International License][cc-by].
|
| 158 |
-
|
| 159 |
-
[![CC BY 4.0][cc-by-image]][cc-by]
|
| 160 |
-
|
| 161 |
-
[cc-by]: http://creativecommons.org/licenses/by/4.0/
|
| 162 |
-
[cc-by-image]: https://i.creativecommons.org/l/by/4.0/88x31.png
|
| 163 |
-
[cc-by-shield]: https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg
|
|
|
|
| 1 |
+
Skip to content
|
| 2 |
+
k-m-irfan
|
| 3 |
+
/
|
| 4 |
+
Fastspeech2_HS_Flask_API
|
| 5 |
+
|
| 6 |
+
Type / to search
|
| 7 |
+
|
| 8 |
+
Code
|
| 9 |
+
Issues
|
| 10 |
+
Pull requests
|
| 11 |
+
Actions
|
| 12 |
+
Projects
|
| 13 |
+
Wiki
|
| 14 |
+
Security
|
| 15 |
+
Insights
|
| 16 |
+
Settings
|
| 17 |
+
Editing README.md in Fastspeech2_HS_Flask_API
|
| 18 |
+
BreadcrumbsFastspeech2_HS_Flask_API
|
| 19 |
+
/
|
| 20 |
+
README.md
|
| 21 |
+
in
|
| 22 |
+
main
|
| 23 |
+
|
| 24 |
+
Edit
|
| 25 |
+
|
| 26 |
+
Preview
|
| 27 |
+
Indent mode
|
| 28 |
+
|
| 29 |
+
Spaces
|
| 30 |
+
Indent size
|
| 31 |
+
|
| 32 |
+
4
|
| 33 |
+
Line wrap mode
|
| 34 |
+
|
| 35 |
+
Soft wrap
|
| 36 |
+
Editing README.md file contents
|
| 37 |
+
Selection deleted
|
| 38 |
+
1
|
| 39 |
+
2
|
| 40 |
+
3
|
| 41 |
+
4
|
| 42 |
+
5
|
| 43 |
+
6
|
| 44 |
+
7
|
| 45 |
+
8
|
| 46 |
+
9
|
| 47 |
+
10
|
| 48 |
+
11
|
| 49 |
+
12
|
| 50 |
+
13
|
| 51 |
+
14
|
| 52 |
+
15
|
| 53 |
+
16
|
| 54 |
+
17
|
| 55 |
+
18
|
| 56 |
+
19
|
| 57 |
+
20
|
| 58 |
+
21
|
| 59 |
+
22
|
| 60 |
+
23
|
| 61 |
+
24
|
| 62 |
+
25
|
| 63 |
+
26
|
| 64 |
+
27
|
| 65 |
+
28
|
| 66 |
+
29
|
| 67 |
+
30
|
| 68 |
+
31
|
| 69 |
+
32
|
| 70 |
+
33
|
| 71 |
+
34
|
| 72 |
+
35
|
| 73 |
+
36
|
| 74 |
+
37
|
| 75 |
+
38
|
| 76 |
+
39
|
| 77 |
+
40
|
| 78 |
+
41
|
| 79 |
---
|
| 80 |
Model Type: Text to Speech
|
| 81 |
Supported Languages: Assamese, Bengali, Bodo, Gujarati, Hindi, Kannada, Malayalam, Manipuri, Marathi, Odia, Punjabi, Rajasthani, Tamil, Telugu, Urdu
|
| 82 |
---
|
| 83 |
+
<img src="https://api.visitorbadge.io/api/visitors?path=https://github.com/k-m-irfan/Fastspeech2_HS_Flask_API&label=VISITORS&countColor=%234285f4" align="right"></br>
|
| 84 |
***Demo: [IITM-TTS Demo](https://iitm-tts.onrender.com) | This may take approximately 30 seconds to load the first time and will go idle after 15 minutes of inactivity.***
|
| 85 |
|
| 86 |
# Fastspeech2_HS_Flask_API
|
|
|
|
| 117 |
```
|
| 118 |
|
| 119 |
Alternatively, you can download the models from the original repository [Fastspeech2_HS](https://github.com/smtiitm/Fastspeech2_HS)
|
| 120 |
+
Use Control + Shift + m to toggle the tab key moving focus. Alternatively, use esc then tab to move to the next interactive element on the page.
|
| 121 |
+
No file chosen
|
| 122 |
+
Attach files by dragging & dropping, selecting or pasting them.
|
| 123 |
+
Editing Fastspeech2_HS_Flask_API/README.md at main · k-m-irfan/Fastspeech2_HS_Flask_API
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|