Tonic commited on
Commit
8fa6df8
1 Parent(s): 38788fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -5
app.py CHANGED
@@ -22,18 +22,24 @@ def speech_to_speech_translation(audio_file):
22
  # Gradio interfaces
23
  iface_s2t = gr.Interface(
24
  fn=speech_to_text,
25
- gr.inputs.Audio(type="file", label="Upload Audio for Speech to Text"),
26
  outputs="text",
27
  title="Speech to Text"
28
  )
29
 
30
  iface_s2st = gr.Interface(
31
  fn=speech_to_speech_translation,
32
- gr.inputs.Audio(type="file", label="Upload Audio for Speech to Speech Translation"),
33
  outputs=["text", "audio"],
34
  title="Speech to Speech Translation"
35
  )
36
 
37
- # Combine into a tabbed interface
38
- iface = gr.TabbedInterface([iface_s2t, iface_s2st], ["Speech to Text", "Speech to Speech Translation"])
39
- iface.launch()
 
 
 
 
 
 
 
22
  # Gradio interfaces
23
  iface_s2t = gr.Interface(
24
  fn=speech_to_text,
25
+ inputs=gr.Audio(type="file", label="Upload Audio for Speech to Text"),
26
  outputs="text",
27
  title="Speech to Text"
28
  )
29
 
30
  iface_s2st = gr.Interface(
31
  fn=speech_to_speech_translation,
32
+ inputs=gr.Audio(type="file", label="Upload Audio for Speech to Speech Translation"),
33
  outputs=["text", "audio"],
34
  title="Speech to Speech Translation"
35
  )
36
 
37
+ # Combine into an accordion interface
38
+ accordion = gr.Accordion(
39
+ iface_s2t,
40
+ iface_s2st,
41
+ labels=["Speech to Text", "Speech to Speech Translation"]
42
+ )
43
+
44
+ # Launch the application
45
+ accordion.launch()