SeyedAli commited on
Commit
7e6c36c
β€’
1 Parent(s): e35048f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
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
- scipy.io.wavfile.write(fp, rate=model.config.sampling_rate, data=np.array(output))
17
- return fp.name
18
- iface = gr.Interface(fn=TTS, inputs="text", outputs="audio")
 
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)