updated code and readme
Browse files- API_Main.py +6 -3
- Dockerfile +16 -11
- README.md +5 -5
- model_related/Bengali_Female/speakers.pth +2 -2
- model_related/Bengali_Male/speakers.pth +2 -2
- model_related/Bhojpuri_Female/speakers.pth +2 -2
- model_related/Bhojpuri_Male/speakers.pth +2 -2
- model_related/Chhattisgarhi_Female/speakers.pth +2 -2
- model_related/Chhattisgarhi_Male/speakers.pth +2 -2
- model_related/English_Female/speakers.pth +2 -2
- model_related/English_Male/speakers.pth +2 -2
- model_related/Gujarati_Female/speakers.pth +2 -2
- model_related/Gujarati_Male/speakers.pth +2 -2
- model_related/Hindi_Female/speakers.pth +2 -2
- model_related/Hindi_Male/speakers.pth +2 -2
- model_related/Kannada_Female/speakers.pth +2 -2
- model_related/Kannada_Male/speakers.pth +2 -2
- model_related/Magahi_Female/speakers.pth +2 -2
- model_related/Magahi_Male/speakers.pth +2 -2
- model_related/Maithili_Female/speakers.pth +2 -2
- model_related/Maithili_Male/speakers.pth +2 -2
- model_related/Marathi_Female/speakers.pth +2 -2
- model_related/Marathi_Male/speakers.pth +2 -2
- model_related/Telugu_Female/speakers.pth +2 -2
- model_related/Telugu_Male/speakers.pth +2 -2
- models/best_model.pth +2 -2
- models/config.json +4 -4
- models/speakers.pth +2 -2
API_Main.py
CHANGED
@@ -11,12 +11,12 @@ from fastapi.responses import Response, JSONResponse
|
|
11 |
|
12 |
|
13 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
14 |
-
print(f"Using device: {device}")
|
15 |
|
16 |
MODEL_PATH = "models/best_model.pth"
|
17 |
CONFIG_PATH = "models/config.json"
|
18 |
|
19 |
-
print(f"Loading model")
|
20 |
tts = TTS(
|
21 |
model_path=MODEL_PATH,
|
22 |
config_path=CONFIG_PATH,
|
@@ -65,6 +65,10 @@ languageCODE = {
|
|
65 |
}
|
66 |
|
67 |
app = FastAPI()
|
|
|
|
|
|
|
|
|
68 |
@app.get("/Get_Inference")
|
69 |
async def Inference(text : str, lang : str, speaker : str):
|
70 |
|
@@ -99,7 +103,6 @@ def start_server():
|
|
99 |
"API_Main:app",
|
100 |
host = "0.0.0.0",
|
101 |
port = 8080,
|
102 |
-
workers = 1,
|
103 |
log_level="debug",
|
104 |
reload=False,
|
105 |
)
|
|
|
11 |
|
12 |
|
13 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
14 |
+
print(f"Using device: {device}", flush = True)
|
15 |
|
16 |
MODEL_PATH = "models/best_model.pth"
|
17 |
CONFIG_PATH = "models/config.json"
|
18 |
|
19 |
+
print(f"Loading model", flush = True)
|
20 |
tts = TTS(
|
21 |
model_path=MODEL_PATH,
|
22 |
config_path=CONFIG_PATH,
|
|
|
65 |
}
|
66 |
|
67 |
app = FastAPI()
|
68 |
+
@app.get("/")
|
69 |
+
def Is_alive():
|
70 |
+
return {"message" : "Server is Live"}
|
71 |
+
|
72 |
@app.get("/Get_Inference")
|
73 |
async def Inference(text : str, lang : str, speaker : str):
|
74 |
|
|
|
103 |
"API_Main:app",
|
104 |
host = "0.0.0.0",
|
105 |
port = 8080,
|
|
|
106 |
log_level="debug",
|
107 |
reload=False,
|
108 |
)
|
Dockerfile
CHANGED
@@ -1,27 +1,32 @@
|
|
1 |
-
FROM
|
2 |
|
3 |
WORKDIR /app
|
4 |
|
5 |
-
|
6 |
|
7 |
RUN apt-get update && apt-get install -y \
|
|
|
|
|
|
|
|
|
8 |
git \
|
9 |
-
|
10 |
-
|
|
|
11 |
&& rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
-
RUN
|
|
|
|
|
14 |
|
15 |
-
RUN
|
16 |
|
17 |
RUN git clone https://github.com/PranavDBhat/LIMMITS-24-Coquiai.git /app/LIMMITS-24-Coquiai
|
18 |
|
19 |
RUN cd /app/LIMMITS-24-Coquiai && \
|
20 |
-
|
21 |
|
22 |
RUN cd /app/LIMMITS-24-Coquiai && \
|
23 |
-
|
24 |
-
|
25 |
-
COPY ./ ./
|
26 |
|
27 |
-
|
|
|
1 |
+
FROM ubuntu:22.04
|
2 |
|
3 |
WORKDIR /app
|
4 |
|
5 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
6 |
|
7 |
RUN apt-get update && apt-get install -y \
|
8 |
+
software-properties-common \
|
9 |
+
&& add-apt-repository ppa:deadsnakes/ppa \
|
10 |
+
&& apt-get update \
|
11 |
+
&& apt-get install -y \
|
12 |
git \
|
13 |
+
python3.10 \
|
14 |
+
python3.10-dev \
|
15 |
+
python3-pip \
|
16 |
&& rm -rf /var/lib/apt/lists/*
|
17 |
|
18 |
+
RUN ln -s /usr/bin/python3.10 /usr/bin/python
|
19 |
+
|
20 |
+
RUN python --version
|
21 |
|
22 |
+
RUN pip3 install --no-cache-dir fastapi python-multipart uvicorn
|
23 |
|
24 |
RUN git clone https://github.com/PranavDBhat/LIMMITS-24-Coquiai.git /app/LIMMITS-24-Coquiai
|
25 |
|
26 |
RUN cd /app/LIMMITS-24-Coquiai && \
|
27 |
+
pip3 install --no-cache-dir -r requirements.txt
|
28 |
|
29 |
RUN cd /app/LIMMITS-24-Coquiai && \
|
30 |
+
pip3 install -e .
|
|
|
|
|
31 |
|
32 |
+
ENTRYPOINT [ "python" ]
|
README.md
CHANGED
@@ -52,7 +52,7 @@ To start the FastAPI server:
|
|
52 |
|
53 |
```bash
|
54 |
docker build -t your_image_name ./
|
55 |
-
docker run -d -p 8080:8080 your_image_name
|
56 |
```
|
57 |
|
58 |
## Hosting on a GPU
|
@@ -135,7 +135,7 @@ docker build -t your_image_name .
|
|
135 |
Start the container with GPU access enabled:
|
136 |
|
137 |
```bash
|
138 |
-
docker run --gpus all -p 8080:8080 your_image_name
|
139 |
```
|
140 |
|
141 |
## Example API Call
|
@@ -148,9 +148,9 @@ base_url = 'http://localhost:8080/Get_Inference'
|
|
148 |
|
149 |
# Set up the query parameters
|
150 |
params = {
|
151 |
-
'text': '
|
152 |
-
'lang': '
|
153 |
-
'speaker': '
|
154 |
}
|
155 |
|
156 |
# Send the GET request
|
|
|
52 |
|
53 |
```bash
|
54 |
docker build -t your_image_name ./
|
55 |
+
docker run -d -v /path/to/this/code/dir/:/app/ -p 8080:8080 your_image_name API_main.py
|
56 |
```
|
57 |
|
58 |
## Hosting on a GPU
|
|
|
135 |
Start the container with GPU access enabled:
|
136 |
|
137 |
```bash
|
138 |
+
docker run --gpus all -p 8080:8080 -v /path/to/this/code/dir/:/app/ your_image_name API_main.py
|
139 |
```
|
140 |
|
141 |
## Example API Call
|
|
|
148 |
|
149 |
# Set up the query parameters
|
150 |
params = {
|
151 |
+
'text': 'ಮಾದರಿಯು ಸರಿಯಾಗಿ ಕಾರ್ಯನಿರ್ವಹಿಸುತ್ತಿದೆಯೇ ಎಂದು ಖಚಿತಪಡಿಸಿಕೊಳ್ಳಲು ಬಳಸಲಾಗುವ ಪರೀಕ್ಷಾ ವಾಕ್ಯ ಇದು.',
|
152 |
+
'lang': 'kannada',
|
153 |
+
'speaker': 'bengali_female'
|
154 |
}
|
155 |
|
156 |
# Send the GET request
|
model_related/Bengali_Female/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:56f54ff1a806ebe607b0095b489f553546cce0b9904d38c531e78e4a86f09e67
|
3 |
+
size 100098080
|
model_related/Bengali_Male/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a860399950439f46083e8e6e7e5c057e10cd7994c6232a09b33fd85f0dd1c1cb
|
3 |
+
size 119368032
|
model_related/Bhojpuri_Female/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:80b05743e5e5c2d8cc10ac96a7e66006f7ed046fc7c7663f83971607afed31e3
|
3 |
+
size 129451808
|
model_related/Bhojpuri_Male/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:60b03f732526e59e5165fe17c243fdb3338dc69d6b4539cd94009e6152955511
|
3 |
+
size 123140960
|
model_related/Chhattisgarhi_Female/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3ab3dc8e3a8946d1a170030f7da2a829441be4a70d9dd9f9689d03360d0bc876
|
3 |
+
size 130934816
|
model_related/Chhattisgarhi_Male/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:973c6233369aade6066051802d3d8165c9199be7bc0144ea0a4ffee18cb315cc
|
3 |
+
size 108560992
|
model_related/English_Female/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ef4b8a8c9e23c9ab0f2e0c053ce85e55b0f3ea34e23dccf2b463502218b7ba1f
|
3 |
+
size 113899296
|
model_related/English_Male/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f1a36e7af9cd38a35a70227b25ec4de0ea9cfdf171bf445bec5731abb65eded4
|
3 |
+
size 118719648
|
model_related/Gujarati_Female/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:81e435824571f839e07984422a3528cb6243da654137560df67b03d2858a75b5
|
3 |
+
size 35408544
|
model_related/Gujarati_Male/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:315f8348df2662c0d04297df825a02190108ede342b3b2926fb9c83b22cbb3cc
|
3 |
+
size 35875360
|
model_related/Hindi_Female/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d36722d9cfa2714f7682d8cd932182b0ecf71663151131a12db01352c6d32672
|
3 |
+
size 103680032
|
model_related/Hindi_Male/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ea4a7831a9fa5961f56bbab0d97d63df34a8189fad2d5294dee2effc5a4e2f24
|
3 |
+
size 116714528
|
model_related/Kannada_Female/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:12ac883789029ddab4f2f6cf0340a0ad52210035513ba2a6676f21f6438a4ee3
|
3 |
+
size 80812384
|
model_related/Kannada_Male/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2af52780734b88535adff48246df32ca4e5b2cf20f0c9f7efcb849d8f024eba4
|
3 |
+
size 97633824
|
model_related/Magahi_Female/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8000b755a4ffd5e6b0a95e2a06dabd02d6f59dbae46776d9a662e214f7f93fb9
|
3 |
+
size 145807392
|
model_related/Magahi_Male/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b7a9007a83759fb8f1cd4bcef79a5b083839d09e1703484caa9d727dd5a1bce8
|
3 |
+
size 153767712
|
model_related/Maithili_Female/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a4f587283f8604bcc95cba0b6e2320041619b76a715b6b0c4253a584acc595a2
|
3 |
+
size 163039520
|
model_related/Maithili_Male/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e7f910296937f346e330e06fc5c7c0afcad3f05f252afd3e941711f2557d197b
|
3 |
+
size 152221920
|
model_related/Marathi_Female/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7e67881879aac91f6653e96f559af5129e023e2879f76fa7bc8e24b77a8236b3
|
3 |
+
size 103038496
|
model_related/Marathi_Male/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7bde8d12edc5745f6c1151f7a0e53bce657a416ad16259a98da14480e330472d
|
3 |
+
size 98007520
|
model_related/Telugu_Female/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:70be39a4e6967100c91ce142d617d1ee23fbba24bd84141bfc67cc71a3cd6ed8
|
3 |
+
size 103993632
|
model_related/Telugu_Male/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b419a9b129289c861f6d2f6d8e0f176e9a245879b5a0c43e5b75ccf0ad9ed93d
|
3 |
+
size 101432480
|
models/best_model.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:df50d69a41b53bb81037c4ef8dcb264fb379618c1afc958211ff809dcd4d3080
|
3 |
+
size 1043587902
|
models/config.json
CHANGED
@@ -556,7 +556,7 @@
|
|
556 |
"use_spectral_norm_disriminator": false,
|
557 |
"use_speaker_embedding": false,
|
558 |
"num_speakers": 0,
|
559 |
-
"speakers_file": "
|
560 |
"d_vector_file": [
|
561 |
"model_related/Bengali_Female/speakers.pth",
|
562 |
"model_related/Chhattisgarhi_Male/speakers.pth",
|
@@ -588,7 +588,7 @@
|
|
588 |
"use_language_embedding": true,
|
589 |
"embedded_language_dim": 4,
|
590 |
"num_languages": 11,
|
591 |
-
"language_ids_file": "
|
592 |
"use_speaker_encoder_as_loss": false,
|
593 |
"speaker_encoder_config_path": "https://github.com/coqui-ai/TTS/releases/download/speaker_encoder_model/config_se.json",
|
594 |
"speaker_encoder_model_path": "https://github.com/coqui-ai/TTS/releases/download/speaker_encoder_model/model_se.pth.tar",
|
@@ -629,9 +629,9 @@
|
|
629 |
"r": 1,
|
630 |
"num_speakers": 0,
|
631 |
"use_speaker_embedding": false,
|
632 |
-
"speakers_file": "
|
633 |
"speaker_embedding_channels": 256,
|
634 |
-
"language_ids_file": "
|
635 |
"use_language_embedding": true,
|
636 |
"use_d_vector_file": true,
|
637 |
"d_vector_file": [
|
|
|
556 |
"use_spectral_norm_disriminator": false,
|
557 |
"use_speaker_embedding": false,
|
558 |
"num_speakers": 0,
|
559 |
+
"speakers_file": "models/speakers.pth",
|
560 |
"d_vector_file": [
|
561 |
"model_related/Bengali_Female/speakers.pth",
|
562 |
"model_related/Chhattisgarhi_Male/speakers.pth",
|
|
|
588 |
"use_language_embedding": true,
|
589 |
"embedded_language_dim": 4,
|
590 |
"num_languages": 11,
|
591 |
+
"language_ids_file": "models/language_ids.json",
|
592 |
"use_speaker_encoder_as_loss": false,
|
593 |
"speaker_encoder_config_path": "https://github.com/coqui-ai/TTS/releases/download/speaker_encoder_model/config_se.json",
|
594 |
"speaker_encoder_model_path": "https://github.com/coqui-ai/TTS/releases/download/speaker_encoder_model/model_se.pth.tar",
|
|
|
629 |
"r": 1,
|
630 |
"num_speakers": 0,
|
631 |
"use_speaker_embedding": false,
|
632 |
+
"speakers_file": "models/speakers.pth",
|
633 |
"speaker_embedding_channels": 256,
|
634 |
+
"language_ids_file": "models/language_ids.json",
|
635 |
"use_language_embedding": true,
|
636 |
"use_d_vector_file": true,
|
637 |
"d_vector_file": [
|
models/speakers.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7cbdf9efca833df8eb54f7366f8a6a21097b28bea6b1490b11277ea41716a6cc
|
3 |
+
size 1312
|