Tlanextli commited on
Commit
06d806f
·
1 Parent(s): ce0e38c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -2,6 +2,8 @@ import os
2
  import gradio as gr
3
  from transformers import pipeline
4
 
 
 
5
  pipeline = pipeline(task="automatic-speech-recognition", model="jonatasgrosman/wav2vec2-large-xlsr-53-german")
6
  #pipeline = pipeline(task="automatic-speech-recognition", model="openai/whisper-large")
7
 
@@ -17,19 +19,21 @@ def transcribeMic(audio):
17
  app1 = gr.Interface(
18
  fn=transcribeFile,
19
  inputs=gr.inputs.Audio(label="Upload audio file", type="filepath"),
20
- outputs="text"
 
21
  )
22
 
23
 
24
  app2 = gr.Interface(
25
  fn=transcribeFile,
26
  inputs=gr.Audio(source="microphone", type="filepath"),
27
- outputs="text"
 
28
  )
29
 
30
 
31
- title = "Speech to text for German"
32
- demo = gr.TabbedInterface(title=title, [app1, app2], ["Audio File", "Microphone"])
33
 
34
  if __name__ == "__main__":
35
  demo.launch()
 
2
  import gradio as gr
3
  from transformers import pipeline
4
 
5
+ title = "Speech to text for German"
6
+
7
  pipeline = pipeline(task="automatic-speech-recognition", model="jonatasgrosman/wav2vec2-large-xlsr-53-german")
8
  #pipeline = pipeline(task="automatic-speech-recognition", model="openai/whisper-large")
9
 
 
19
  app1 = gr.Interface(
20
  fn=transcribeFile,
21
  inputs=gr.inputs.Audio(label="Upload audio file", type="filepath"),
22
+ outputs="text",
23
+ title=title
24
  )
25
 
26
 
27
  app2 = gr.Interface(
28
  fn=transcribeFile,
29
  inputs=gr.Audio(source="microphone", type="filepath"),
30
+ outputs="text",
31
+ title=title
32
  )
33
 
34
 
35
+
36
+ demo = gr.TabbedInterface([app1, app2], ["Audio File", "Microphone"])
37
 
38
  if __name__ == "__main__":
39
  demo.launch()