yama commited on
Commit
8873cb0
1 Parent(s): bc3c920

Update app.py

Browse files
Files changed (3) hide show
  1. app.py +37 -0
  2. sample1.wav +0 -0
  3. sample2.wav +0 -0
app.py CHANGED
@@ -350,4 +350,41 @@ with demo:
350
  download_transcript.render()
351
  transcription_df.render()
352
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
  demo.launch(debug=True)
 
350
  download_transcript.render()
351
  transcription_df.render()
352
 
353
+ with gr.Tab("Whisper Transcribe Japanese Audio"):
354
+ gr.Markdown(f'''
355
+ <div>
356
+ <h1 style='text-align: center'>Whisper Transcribe Japanese Audio</h1>
357
+ </div>
358
+ Transcribe long-form microphone or audio inputs with the click of a button! The fine-tuned
359
+ checkpoint <a href='https://huggingface.co/{MODEL_NAME}' target='_blank'><b>{MODEL_NAME}</b></a> to transcribe audio files of arbitrary length.
360
+ ''')
361
+ microphone = gr.inputs.Audio(source="microphone", type="filepath", optional=True)
362
+ upload = gr.inputs.Audio(source="upload", type="filepath", optional=True)
363
+ transcribe_btn = gr.Button("Transcribe Audio")
364
+ text_output = gr.Textbox()
365
+ with gr.Row():
366
+ gr.Markdown('''
367
+ ### You can test by following examples:
368
+ ''')
369
+ examples = gr.Examples(examples=
370
+ ["sample1.wav",
371
+ "sample2.wav",
372
+ ],
373
+ label="Examples", inputs=[upload])
374
+ transcribe_btn.click(transcribe, [microphone, upload], outputs=text_output)
375
+
376
+ with gr.Tab("Whisper Transcribe Japanese YouTube"):
377
+ gr.Markdown(f'''
378
+ <div>
379
+ <h1 style='text-align: center'>Whisper Transcribe Japanese YouTube</h1>
380
+ </div>
381
+ Transcribe long-form YouTube videos with the click of a button! The fine-tuned checkpoint:
382
+ <a href='https://huggingface.co/{MODEL_NAME}' target='_blank'><b>{MODEL_NAME}</b></a> to transcribe audio files of arbitrary length.
383
+ ''')
384
+ youtube_link = gr.Textbox(label="Youtube url", lines=1, interactive=True)
385
+ yt_transcribe_btn = gr.Button("Transcribe YouTube")
386
+ text_output2 = gr.Textbox()
387
+ html_output = gr.Markdown()
388
+ yt_transcribe_btn.click(yt_transcribe, [youtube_link], outputs=[html_output, text_output2])
389
+
390
  demo.launch(debug=True)
sample1.wav ADDED
Binary file (306 kB). View file
 
sample2.wav ADDED
Binary file (470 kB). View file