navyaparesh commited on
Commit
0e4db4a
·
verified ·
1 Parent(s): e93d7e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -7
app.py CHANGED
@@ -48,6 +48,7 @@ This Gradio demo showcases **IndicConformer**, a speech recognition model for **
48
  3. Click **"Transcribe"** to generate the corresponding text.
49
  4. View or copy the output for further use.
50
 
 
51
  """
52
 
53
  hf_token = os.getenv("HF_TOKEN")
@@ -155,19 +156,27 @@ with gr.Blocks() as demo_asr_ctc:
155
  btn = gr.Button("Transcribe")
156
  with gr.Column():
157
  output_text = gr.Textbox(label="Transcribed text")
 
 
 
 
 
 
 
 
158
  inputs=[input_audio, target_language],
159
  outputs=output_text,
160
  fn=run_asr_ctc,
161
  cache_examples=CACHE_EXAMPLES,
162
  api_name=False,
163
- # )
164
 
165
- # btn.click(
166
- # fn=run_asr_ctc,
167
- # inputs=[input_audio, target_language],
168
- # outputs=output_text,
169
- # api_name="asr",
170
- # )
171
 
172
  with gr.Blocks() as demo_asr_rnnt:
173
  with gr.Row():
@@ -182,6 +191,14 @@ with gr.Blocks() as demo_asr_rnnt:
182
  btn = gr.Button("Transcribe")
183
  with gr.Column():
184
  output_text = gr.Textbox(label="Transcribed text")
 
 
 
 
 
 
 
 
185
  inputs=[input_audio, target_language],
186
  outputs=output_text,
187
  fn=run_asr_rnnt,
 
48
  3. Click **"Transcribe"** to generate the corresponding text.
49
  4. View or copy the output for further use.
50
 
51
+
52
  """
53
 
54
  hf_token = os.getenv("HF_TOKEN")
 
156
  btn = gr.Button("Transcribe")
157
  with gr.Column():
158
  output_text = gr.Textbox(label="Transcribed text")
159
+
160
+ gr.Examples(
161
+ examples=[
162
+ ["assets/Bengali.wav", "Bengali", "English"],
163
+ ["assets/Gujarati.wav", "Gujarati", "Hindi"],
164
+ ["assets/Punjabi.wav", "Punjabi", "Hindi"],
165
+
166
+ ],
167
  inputs=[input_audio, target_language],
168
  outputs=output_text,
169
  fn=run_asr_ctc,
170
  cache_examples=CACHE_EXAMPLES,
171
  api_name=False,
172
+ )
173
 
174
+ btn.click(
175
+ fn=run_asr_ctc,
176
+ inputs=[input_audio, target_language],
177
+ outputs=output_text,
178
+ api_name="asr",
179
+ )
180
 
181
  with gr.Blocks() as demo_asr_rnnt:
182
  with gr.Row():
 
191
  btn = gr.Button("Transcribe")
192
  with gr.Column():
193
  output_text = gr.Textbox(label="Transcribed text")
194
+
195
+ gr.Examples(
196
+ examples=[
197
+ ["assets/Bengali.wav", "Bengali", "English"],
198
+ ["assets/Gujarati.wav", "Gujarati", "Hindi"],
199
+ ["assets/Punjabi.wav", "Punjabi", "Hindi"],
200
+
201
+ ],
202
  inputs=[input_audio, target_language],
203
  outputs=output_text,
204
  fn=run_asr_rnnt,