usamadv commited on
Commit
e218d7b
Β·
verified Β·
1 Parent(s): 3304724

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from mai import speech_to_speech_translation
2
+ import gradio as gr
3
+
4
+ demo = gr.Blocks()
5
+
6
+ mic_translate = gr.Interface(
7
+ fn=speech_to_speech_translation,
8
+ inputs=gr.Audio(source="microphone", type="filepath"),
9
+ outputs=gr.Audio(label="Generated Speech", type="numpy"),
10
+ )
11
+
12
+ file_translate = gr.Interface(
13
+ fn=speech_to_speech_translation,
14
+ inputs=gr.Audio(source="upload", type="filepath"),
15
+ outputs=gr.Audio(label="Generated Speech", type="numpy"),
16
+ )
17
+
18
+ with demo:
19
+ gr.TabbedInterface([mic_translate, file_translate], ["Microphone", "Audio File"])
20
+
21
+ demo.launch(debug=True)