Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,8 +12,9 @@ def TTS(text):
|
|
12 |
inputs = tokenizer(text, return_tensors="pt")
|
13 |
with torch.no_grad():
|
14 |
output = model(**inputs).waveform
|
15 |
-
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
19 |
iface.launch(share=False)
|
|
|
12 |
inputs = tokenizer(text, return_tensors="pt")
|
13 |
with torch.no_grad():
|
14 |
output = model(**inputs).waveform
|
15 |
+
# with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
|
16 |
+
# scipy.io.wavfile.write(fp, rate=model.config.sampling_rate, data=output)
|
17 |
+
# return fp.name
|
18 |
+
return output
|
19 |
+
iface = gr.Interface(fn=TTS, inputs="text", outputs="text")
|
20 |
iface.launch(share=False)
|