Spaces:
Runtime error
Runtime error
Commit
·
cd46ed3
1
Parent(s):
f5fcce9
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ from TTS.utils.synthesizer import Synthesizer
|
|
5 |
|
6 |
model_path = "./model/model.pth"
|
7 |
config_path = "./model/config.json"
|
|
|
8 |
|
9 |
synthesizer = Synthesizer(
|
10 |
tts_checkpoint=model_path,
|
@@ -21,8 +22,11 @@ synthesizer = Synthesizer(
|
|
21 |
def run_tts(text):
|
22 |
|
23 |
wav = synthesizer.tts(text)
|
|
|
24 |
|
25 |
-
|
|
|
|
|
26 |
|
27 |
|
28 |
iface = gr.Interface(fn=run_tts, inputs="text", outputs="audio")
|
|
|
5 |
|
6 |
model_path = "./model/model.pth"
|
7 |
config_path = "./model/config.json"
|
8 |
+
output_path = "out/"
|
9 |
|
10 |
synthesizer = Synthesizer(
|
11 |
tts_checkpoint=model_path,
|
|
|
22 |
def run_tts(text):
|
23 |
|
24 |
wav = synthesizer.tts(text)
|
25 |
+
output_file = os.path.join(output_path, "inference.wav")
|
26 |
|
27 |
+
synthesizer.save_wav(wav, output_file)
|
28 |
+
|
29 |
+
return output_file
|
30 |
|
31 |
|
32 |
iface = gr.Interface(fn=run_tts, inputs="text", outputs="audio")
|