BasToTheMax commited on
Commit
82f9906
·
1 Parent(s): e04af2a
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -1,15 +1,18 @@
1
  import gradio as gr
2
  from TTS.api import TTS
 
3
 
4
  api = TTS(model_name="voice_conversion_models/multilingual/vctk/freevc24")
5
 
6
  def greet(source, target):
7
- print("adio", source, target)
8
- api.voice_conversion_to_file(source_wav=source, target_wav=target, file_path="/tmp/out.wav")
 
 
9
  print("> Done")
10
 
11
- return "/tmp/out.wav"
12
 
13
  app = gr.Interface(fn=greet, inputs=[gr.Audio(type="filepath"), gr.Audio(type="filepath")], outputs=gr.Audio(type="filepath"))
14
- app.queue(max_size=5000, concurrency_count=1)
15
  app.launch()
 
1
  import gradio as gr
2
  from TTS.api import TTS
3
+ import tempfile
4
 
5
  api = TTS(model_name="voice_conversion_models/multilingual/vctk/freevc24")
6
 
7
  def greet(source, target):
8
+ path = tempfile.NamedTemporaryFile().name
9
+
10
+ print("adio", source, target, path)
11
+ api.voice_conversion_to_file(source_wav=source, target_wav=target, file_path=path)
12
  print("> Done")
13
 
14
+ return path
15
 
16
  app = gr.Interface(fn=greet, inputs=[gr.Audio(type="filepath"), gr.Audio(type="filepath")], outputs=gr.Audio(type="filepath"))
17
+ app.queue(max_size=5000, concurrency_count=5)
18
  app.launch()