Mahiruoshi
commited on
Commit
•
4011fcb
1
Parent(s):
95e727e
Update app.py
Browse files
app.py
CHANGED
@@ -18,6 +18,7 @@ from text.symbols import symbols
|
|
18 |
from text import text_to_sequence
|
19 |
import unicodedata
|
20 |
from scipy.io.wavfile import write
|
|
|
21 |
def get_text(text, hps):
|
22 |
text_norm = text_to_sequence(text, hps.data.text_cleaners)
|
23 |
if hps.data.add_blank:
|
@@ -25,17 +26,12 @@ def get_text(text, hps):
|
|
25 |
text_norm = torch.LongTensor(text_norm)
|
26 |
return text_norm
|
27 |
|
28 |
-
|
29 |
def get_label(text, label):
|
30 |
if f'[{label}]' in text:
|
31 |
return True, text.replace(f'[{label}]', '')
|
32 |
else:
|
33 |
return False, text
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
def selection(speaker):
|
40 |
if speaker == "高咲侑":
|
41 |
spk = 0
|
@@ -115,8 +111,8 @@ def infer(language,text,speaker_id, n_scale= 0.667,n_scale_w = 0.8, l_scale = 1
|
|
115 |
spending_time = "推理时间:"+str(t2-t1)+"s"
|
116 |
print(spending_time)
|
117 |
return (hps_ms.data.sampling_rate, audio)
|
118 |
-
lan = ["中文","日文","英文"]
|
119 |
-
idols = ["
|
120 |
|
121 |
|
122 |
|
|
|
18 |
from text import text_to_sequence
|
19 |
import unicodedata
|
20 |
from scipy.io.wavfile import write
|
21 |
+
|
22 |
def get_text(text, hps):
|
23 |
text_norm = text_to_sequence(text, hps.data.text_cleaners)
|
24 |
if hps.data.add_blank:
|
|
|
26 |
text_norm = torch.LongTensor(text_norm)
|
27 |
return text_norm
|
28 |
|
|
|
29 |
def get_label(text, label):
|
30 |
if f'[{label}]' in text:
|
31 |
return True, text.replace(f'[{label}]', '')
|
32 |
else:
|
33 |
return False, text
|
34 |
|
|
|
|
|
|
|
|
|
35 |
def selection(speaker):
|
36 |
if speaker == "高咲侑":
|
37 |
spk = 0
|
|
|
111 |
spending_time = "推理时间:"+str(t2-t1)+"s"
|
112 |
print(spending_time)
|
113 |
return (hps_ms.data.sampling_rate, audio)
|
114 |
+
lan = ["中文","日文","英文(摆啦,有需要可以放17号位重新训练)"]
|
115 |
+
idols = ["高咲侑(误)","歩夢","かすみ","しずく","果林","愛","彼方","せつ菜","璃奈","栞子","エマ","ランジュ","ミア","三色绘恋1","三色绘恋2","派蒙"]
|
116 |
|
117 |
|
118 |
|