Codeblockz commited on
Commit
70a94fa
·
verified ·
1 Parent(s): c55e11c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -10,14 +10,13 @@ tts_pipe = pipeline("text-to-speech",
10
 
11
  def launch(input):
12
  out = pipe(input)
13
- narrated_text = tts_pipe(out[0]['generated_text'])
14
- IPythonAudio(narrated_text["audio"][0],
15
- rate=narrated_text["sampling_rate"])
16
- return out[0]['generated_text']
17
 
18
  iface = gr.Interface(launch,
19
  inputs=gr.Image(type='pil'),
20
- outputs="text")
21
  iface.launch()
22
 
23
 
 
10
 
11
  def launch(input):
12
  out = pipe(input)
13
+ out_tts = tts_pipe(out[0]['generated_text'])
14
+ return out[0]['generated_text'], (out_tts["sampling_rate"],out_tts["audio"][0])
15
+
 
16
 
17
  iface = gr.Interface(launch,
18
  inputs=gr.Image(type='pil'),
19
+ outputs=["text","audio"])
20
  iface.launch()
21
 
22