Spaces:
Build error
Build error
Commit
·
f4b46dd
1
Parent(s):
576bebe
Update app.py
Browse files
app.py
CHANGED
@@ -26,6 +26,11 @@ westerkwartiers_text2speech = Text2Speech.from_pretrained(
|
|
26 |
vocoder_tag="parallel_wavegan/ljspeech_parallel_wavegan.v3"
|
27 |
)
|
28 |
|
|
|
|
|
|
|
|
|
|
|
29 |
def inference(text,lang):
|
30 |
with torch.no_grad():
|
31 |
if lang == "gronings":
|
@@ -34,6 +39,9 @@ def inference(text,lang):
|
|
34 |
elif lang == "gronings westerkwartiers":
|
35 |
wav = westerkwartiers_text2speech(text)["wav"]
|
36 |
scipy.io.wavfile.write("out.wav", westerkwartiers_text2speech.fs , wav.view(-1).cpu().numpy())
|
|
|
|
|
|
|
37 |
|
38 |
return "out.wav", "out.wav"
|
39 |
|
@@ -45,7 +53,7 @@ examples = [
|
|
45 |
|
46 |
gr.Interface(
|
47 |
inference,
|
48 |
-
[gr.inputs.Textbox(label="input text", lines=3), gr.inputs.Radio(choices=["gronings", "gronings westerkwartiers"], type="value", default="gronings", label="language")],
|
49 |
[gr.outputs.Audio(type="file", label="Output"), gr.outputs.File()],
|
50 |
title=title,
|
51 |
examples=examples
|
|
|
26 |
vocoder_tag="parallel_wavegan/ljspeech_parallel_wavegan.v3"
|
27 |
)
|
28 |
|
29 |
+
oldambster_text2speech = Text2Speech.from_pretrained(
|
30 |
+
model_tag="https://huggingface.co/ahnafsamin/FastSpeech2-gronings-oldambster/resolve/main/tts_train_fastspeech2_raw_char_tacotron_train.loss.ave.zip",
|
31 |
+
vocoder_tag="parallel_wavegan/ljspeech_parallel_wavegan.v3"
|
32 |
+
)
|
33 |
+
|
34 |
def inference(text,lang):
|
35 |
with torch.no_grad():
|
36 |
if lang == "gronings":
|
|
|
39 |
elif lang == "gronings westerkwartiers":
|
40 |
wav = westerkwartiers_text2speech(text)["wav"]
|
41 |
scipy.io.wavfile.write("out.wav", westerkwartiers_text2speech.fs , wav.view(-1).cpu().numpy())
|
42 |
+
elif lang == "gronings oldambster":
|
43 |
+
wav = oldambster_text2speech(text)["wav"]
|
44 |
+
scipy.io.wavfile.write("out.wav", oldambster_text2speech.fs , wav.view(-1).cpu().numpy())
|
45 |
|
46 |
return "out.wav", "out.wav"
|
47 |
|
|
|
53 |
|
54 |
gr.Interface(
|
55 |
inference,
|
56 |
+
[gr.inputs.Textbox(label="input text", lines=3), gr.inputs.Radio(choices=["gronings", "gronings westerkwartiers", "gronings oldambster"], type="value", default="gronings", label="language")],
|
57 |
[gr.outputs.Audio(type="file", label="Output"), gr.outputs.File()],
|
58 |
title=title,
|
59 |
examples=examples
|