Martijn Bartelds
commited on
Commit
·
6425ecd
1
Parent(s):
300bd05
Update app
Browse files
app.py
CHANGED
@@ -21,13 +21,13 @@ gos_text2speech = Text2Speech.from_pretrained(
|
|
21 |
def inference(text,lang):
|
22 |
with torch.no_grad():
|
23 |
if lang == "Hoogelaandsters":
|
24 |
-
wav = gos_text2speech(text, sids=np.array([1]))["wav"]
|
25 |
scipy.io.wavfile.write("out.wav", gos_text2speech.fs , wav.view(-1).cpu().numpy())
|
26 |
if lang == "Oldambsters":
|
27 |
-
wav = gos_text2speech(text, sids=np.array([2]))["wav"]
|
28 |
scipy.io.wavfile.write("out.wav", gos_text2speech.fs , wav.view(-1).cpu().numpy())
|
29 |
if lang == "Westerkertaaiers":
|
30 |
-
wav = gos_text2speech(text, sids=np.array([3]))["wav"]
|
31 |
scipy.io.wavfile.write("out.wav", gos_text2speech.fs , wav.view(-1).cpu().numpy())
|
32 |
|
33 |
return "out.wav", "out.wav"
|
|
|
21 |
def inference(text,lang):
|
22 |
with torch.no_grad():
|
23 |
if lang == "Hoogelaandsters":
|
24 |
+
wav = gos_text2speech(text.lower(), sids=np.array([1]))["wav"]
|
25 |
scipy.io.wavfile.write("out.wav", gos_text2speech.fs , wav.view(-1).cpu().numpy())
|
26 |
if lang == "Oldambsters":
|
27 |
+
wav = gos_text2speech(text.lower(), sids=np.array([2]))["wav"]
|
28 |
scipy.io.wavfile.write("out.wav", gos_text2speech.fs , wav.view(-1).cpu().numpy())
|
29 |
if lang == "Westerkertaaiers":
|
30 |
+
wav = gos_text2speech(text.lower(), sids=np.array([3]))["wav"]
|
31 |
scipy.io.wavfile.write("out.wav", gos_text2speech.fs , wav.view(-1).cpu().numpy())
|
32 |
|
33 |
return "out.wav", "out.wav"
|