Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,12 +6,6 @@ import gradio as gr
|
|
6 |
import os
|
7 |
|
8 |
|
9 |
-
def download_assets():
|
10 |
-
os.system("gdown --id 16UhN8QBxG1YYwUh8smdEeVnKo9qZhvZj -O duration_latest_ckpt.pickle")
|
11 |
-
os.system("gdown --id 19cRNDC6IrHFAAE4U9I7K0mzLMgPsi5zb -O hk_hifi.pickle")
|
12 |
-
os.system("wget https://raw.githubusercontent.com/NTT123/vietTTS/master/assets/hifigan/config.json")
|
13 |
-
os.system("wget https://raw.githubusercontent.com/NTT123/vietTTS/master/assets/infore/lexicon.txt")
|
14 |
-
|
15 |
def text_to_speech(text):
|
16 |
# prevent too long text
|
17 |
if len(text) > 500:
|
@@ -22,7 +16,7 @@ def text_to_speech(text):
|
|
22 |
"lexicon.txt",
|
23 |
0.2,
|
24 |
"acoustic_ckpt_latest.pickle",
|
25 |
-
"
|
26 |
)
|
27 |
wave = mel2wave(mel, "config.json", "hk_hifi.pickle")
|
28 |
return (wave * (2**15)).astype(np.int16)
|
@@ -33,8 +27,6 @@ def speak(text):
|
|
33 |
return 16_000, y
|
34 |
|
35 |
|
36 |
-
download_assets()
|
37 |
-
|
38 |
title = "vietTTS"
|
39 |
description = "A vietnamese text-to-speech demo."
|
40 |
|
@@ -48,4 +40,3 @@ gr.Interface(
|
|
48 |
allow_screenshot=False,
|
49 |
allow_flagging="never",
|
50 |
).launch(debug=False)
|
51 |
-
# edited
|
|
|
6 |
import os
|
7 |
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
def text_to_speech(text):
|
10 |
# prevent too long text
|
11 |
if len(text) > 500:
|
|
|
16 |
"lexicon.txt",
|
17 |
0.2,
|
18 |
"acoustic_ckpt_latest.pickle",
|
19 |
+
"duration_ckpt_latest.pickle",
|
20 |
)
|
21 |
wave = mel2wave(mel, "config.json", "hk_hifi.pickle")
|
22 |
return (wave * (2**15)).astype(np.int16)
|
|
|
27 |
return 16_000, y
|
28 |
|
29 |
|
|
|
|
|
30 |
title = "vietTTS"
|
31 |
description = "A vietnamese text-to-speech demo."
|
32 |
|
|
|
40 |
allow_screenshot=False,
|
41 |
allow_flagging="never",
|
42 |
).launch(debug=False)
|
|