clr commited on
Commit
c9afa80
·
1 Parent(s): a33cf00

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -41,9 +41,9 @@ def recc(audio_file,model,processor):
41
 
42
 
43
  def recis(audio_file):
44
- output = pipe_is(audio_file, chunk_length_s=10, stride_length_s=(4, 2))
45
- return output
46
- #return recc(audio_file,model_is,processor_is)
47
 
48
  def recfo(audio_file):
49
  return recc(audio_file,model_fo,processor_fo)
@@ -69,9 +69,11 @@ with bl:
69
  with gr.TabItem("Icelandic"):
70
  with gr.Row():
71
  audio_file = gr.Audio(type="filepath")
72
- text_output = gr.Textbox()
 
 
73
  text_button = gr.Button("Recognise Icelandic")
74
- text_button.click(recis, inputs=audio_file, outputs=text_output)
75
  with gr.TabItem("Faroese"):
76
  with gr.Row():
77
  audio_file = gr.Audio(type="filepath")
 
41
 
42
 
43
  def recis(audio_file):
44
+ single_output = recc(audio_file,model_is,processor_is)
45
+ chunk_output = pipe_is(audio_file, chunk_length_s=6)['text']
46
+ return (single_output, chunk_output)
47
 
48
  def recfo(audio_file):
49
  return recc(audio_file,model_fo,processor_fo)
 
69
  with gr.TabItem("Icelandic"):
70
  with gr.Row():
71
  audio_file = gr.Audio(type="filepath")
72
+ with gr.Column():
73
+ whole_output = gr.Textbox(label="whole-file recognition")
74
+ chunk_output = gr.Textbox("recognition with chunking")
75
  text_button = gr.Button("Recognise Icelandic")
76
+ text_button.click(recis, inputs=audio_file, outputs=[whole_output,chunk_output])
77
  with gr.TabItem("Faroese"):
78
  with gr.Row():
79
  audio_file = gr.Audio(type="filepath")