Spaces:
Running
Running
Update app.py
Browse filesspeaker choise available
app.py
CHANGED
@@ -38,10 +38,10 @@ _ = net_g.eval()
|
|
38 |
_ = utils.load_checkpoint("fr_wa_finetuned_pho/G_125000.pth", net_g, None)
|
39 |
|
40 |
|
41 |
-
def tts(text):
|
42 |
if len(text) > 350:
|
43 |
return "Error: Text is too long", None
|
44 |
-
sid = torch.LongTensor([
|
45 |
stn_tst = get_text(text, hps)
|
46 |
|
47 |
with torch.no_grad():
|
@@ -55,14 +55,15 @@ def tts(text):
|
|
55 |
app = gr.Blocks()
|
56 |
with app:
|
57 |
with gr.Tabs():
|
58 |
-
with gr.TabItem("
|
59 |
-
tts_input1 = gr.TextArea(label="Text in Walloon (350 words limitation)", value="")
|
60 |
-
|
61 |
tts_submit = gr.Button("Generate", variant="primary")
|
62 |
tts_output1 = gr.Textbox(label="Message")
|
63 |
tts_output2 = gr.Audio(label="Output")
|
64 |
-
tts_submit.click(tts, [tts_input1], [tts_output1, tts_output2])
|
65 |
|
66 |
app.launch()
|
67 |
|
|
|
68 |
|
|
|
38 |
_ = utils.load_checkpoint("fr_wa_finetuned_pho/G_125000.pth", net_g, None)
|
39 |
|
40 |
|
41 |
+
def tts(text, speaker_id):
|
42 |
if len(text) > 350:
|
43 |
return "Error: Text is too long", None
|
44 |
+
sid = torch.LongTensor([speaker_id]) # speaker identity
|
45 |
stn_tst = get_text(text, hps)
|
46 |
|
47 |
with torch.no_grad():
|
|
|
55 |
app = gr.Blocks()
|
56 |
with app:
|
57 |
with gr.Tabs():
|
58 |
+
with gr.TabItem("Phonemes_finetuned"):
|
59 |
+
tts_input1 = gr.TextArea(label="Text in Walloon in phonemes IPA (350 words limitation)", value="")
|
60 |
+
tts_input2 = gr.Dropdown(label="Speaker", choices=["Male", "Female"], type="index", value="Male")
|
61 |
tts_submit = gr.Button("Generate", variant="primary")
|
62 |
tts_output1 = gr.Textbox(label="Message")
|
63 |
tts_output2 = gr.Audio(label="Output")
|
64 |
+
tts_submit.click(tts, [tts_input1, tts_input2], [tts_output1, tts_output2])
|
65 |
|
66 |
app.launch()
|
67 |
|
68 |
+
|
69 |
|