Commit
·
161b131
1
Parent(s):
361bf5f
Update app.py
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ def sle(language,text):
|
|
60 |
return text
|
61 |
|
62 |
def get_text(text,hps_ms):
|
63 |
-
text_norm = text_to_sequence(text,hps_ms.data.text_cleaners)
|
64 |
if hps_ms.data.add_blank:
|
65 |
text_norm = commons.intersperse(text_norm, 0)
|
66 |
text_norm = torch.LongTensor(text_norm)
|
@@ -69,7 +69,7 @@ def get_text(text,hps_ms):
|
|
69 |
def create_tts_fn(ort_sess, speaker_id):
|
70 |
def tts_fn(text , language, n_scale= 0.667,n_scale_w = 0.8, l_scale = 1 ):
|
71 |
text =sle(language,text)
|
72 |
-
seq = text_to_sequence(text, cleaner_names=hps.data.text_cleaners)
|
73 |
if hps.data.add_blank:
|
74 |
seq = commons.intersperse(seq, 0)
|
75 |
with torch.no_grad():
|
@@ -152,8 +152,8 @@ if __name__ == '__main__':
|
|
152 |
input2 = gr.Dropdown(label="Language", choices=lan, value="自动", interactive=True)
|
153 |
with gr.Column():
|
154 |
input1 = gr.TextArea(label="Text", value=example)
|
155 |
-
input4 = gr.Slider(minimum=0, maximum=1.0, label="更改噪声比例(noise scale),以控制情感", value=0.
|
156 |
-
input5 = gr.Slider(minimum=0, maximum=1.0, label="更改噪声偏差(noise scale w),以控制音素长短", value=0.
|
157 |
input6 = gr.Slider(minimum=0.1, maximum=10, label="duration", value=1)
|
158 |
btnVC = gr.Button("Submit")
|
159 |
output1 = gr.Audio(label="采样率22050")
|
|
|
60 |
return text
|
61 |
|
62 |
def get_text(text,hps_ms):
|
63 |
+
text_norm = text_to_sequence(text,hps_ms.symbols,hps_ms.data.text_cleaners)
|
64 |
if hps_ms.data.add_blank:
|
65 |
text_norm = commons.intersperse(text_norm, 0)
|
66 |
text_norm = torch.LongTensor(text_norm)
|
|
|
69 |
def create_tts_fn(ort_sess, speaker_id):
|
70 |
def tts_fn(text , language, n_scale= 0.667,n_scale_w = 0.8, l_scale = 1 ):
|
71 |
text =sle(language,text)
|
72 |
+
seq = text_to_sequence(text,hps.symbols, cleaner_names=hps.data.text_cleaners)
|
73 |
if hps.data.add_blank:
|
74 |
seq = commons.intersperse(seq, 0)
|
75 |
with torch.no_grad():
|
|
|
152 |
input2 = gr.Dropdown(label="Language", choices=lan, value="自动", interactive=True)
|
153 |
with gr.Column():
|
154 |
input1 = gr.TextArea(label="Text", value=example)
|
155 |
+
input4 = gr.Slider(minimum=0, maximum=1.0, label="更改噪声比例(noise scale),以控制情感", value=0.667)
|
156 |
+
input5 = gr.Slider(minimum=0, maximum=1.0, label="更改噪声偏差(noise scale w),以控制音素长短", value=0.8)
|
157 |
input6 = gr.Slider(minimum=0.1, maximum=10, label="duration", value=1)
|
158 |
btnVC = gr.Button("Submit")
|
159 |
output1 = gr.Audio(label="采样率22050")
|