unijoh commited on
Commit
a7f185d
1 Parent(s): e8999ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -23
app.py CHANGED
@@ -1,34 +1,27 @@
1
  import gradio as gr
2
  from asr import transcribe
3
  from tts import synthesize_speech
4
- from lid import identify_language
5
 
6
  def main():
7
- asr_interface = gr.Interface(
8
- fn=transcribe,
9
- inputs=gr.Audio(type="filepath"),
10
- outputs="text",
11
- title="Faroese ASR Demo",
12
- description="Automatic Speech Recognition for Faroese"
13
- )
14
 
15
- tts_interface = gr.Interface(
16
- fn=synthesize_speech,
17
- inputs="text",
18
- outputs="audio",
19
- title="Faroese TTS Demo",
20
- description="Text-to-Speech Synthesis for Faroese"
21
- )
22
 
23
- lid_interface = gr.Interface(
24
- fn=identify_language,
25
- inputs=gr.Audio(type="filepath"),
26
- outputs="label",
27
- title="Language Identification",
28
- description="Identify the language of the spoken input"
29
- )
 
 
30
 
31
- demo = gr.TabbedInterface([asr_interface, tts_interface, lid_interface], ["ASR", "TTS", "LID"])
32
  demo.launch()
33
 
34
  if __name__ == "__main__":
 
1
  import gradio as gr
2
  from asr import transcribe
3
  from tts import synthesize_speech
4
+ from lid import identify
5
 
6
  def main():
7
+ with gr.Blocks() as demo:
8
+ gr.Markdown("# Faroese ASR, TTS, and LID Demo")
 
 
 
 
 
9
 
10
+ with gr.Tab("ASR"):
11
+ gr.Audio(type="filepath", label=None)
12
+ gr.Button("Transcribe")
13
+ gr.Textbox()
 
 
 
14
 
15
+ with gr.Tab("TTS"):
16
+ gr.Textbox(label="Text Input")
17
+ gr.Button("Synthesize")
18
+ gr.Audio()
19
+
20
+ with gr.Tab("LID"):
21
+ gr.Audio(type="filepath", label=None)
22
+ gr.Button("Identify Language")
23
+ gr.Textbox()
24
 
 
25
  demo.launch()
26
 
27
  if __name__ == "__main__":