Ahsen Khaliq commited on
Commit
1e04ba6
1 Parent(s): 4ded62e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -1,10 +1,9 @@
1
  import gradio as gr
2
  import os
 
3
 
4
  def inference(audio, text):
5
- print(text)
6
- print(text.strip())
7
- os.system("python demo_cli.py --audio_path "+audio.name+" --text "+text.strip())
8
  return 'demo_output_1.wav'
9
 
10
  iface = gr.Interface(inference, inputs=[gr.inputs.Audio(type="file"),"text"], outputs=gr.outputs.Audio(type="file"))
 
1
  import gradio as gr
2
  import os
3
+ import shlex
4
 
5
  def inference(audio, text):
6
+ os.system("python demo_cli.py --audio_path "+audio.name+" --text "+shlex.quote(text.strip()))
 
 
7
  return 'demo_output_1.wav'
8
 
9
  iface = gr.Interface(inference, inputs=[gr.inputs.Audio(type="file"),"text"], outputs=gr.outputs.Audio(type="file"))