tools4eu commited on
Commit
34c8a2c
1 Parent(s): 995d8d1

disabling folder processing until it's out of beta

Browse files
Files changed (1) hide show
  1. src/app.py +32 -32
src/app.py CHANGED
@@ -244,39 +244,39 @@ with gr.Blocks(title="Automatic speech recognition (beta)", css=css, analytics_e
244
  with gr.Column():
245
  textbox = gr.Textbox(label='Transciption',visible=True)
246
 
247
- with gr.Tab("Process multiple files"):
248
- files_source=gr.Files(label="Select Audio Files", file_count="multiple")
249
- with gr.Column():
250
- dropdown_model_multi = gr.Dropdown(
251
- label='Model',
252
- choices = ["openai/whisper-large-v3", "openai/whisper-medium", "openai/whisper-small", "openai/whisper-tiny"],
253
- value="openai/whisper-large-v3",
254
- info="""
255
- Larger models will increase the quality of the transcription, but reduce performance.
256
- """)
257
- dropdown_lang_multi = gr.Dropdown(
258
- label='Language',
259
- choices = ['Automatic detection']+sorted(list(languages.keys())),
260
- value='Automatic detection',
261
- info="""
262
- Setting the language to "Automatic detection" will auto-detect the language based on the first 30 seconds.
263
- If the language is known upfront, always set it manually.
264
- """)
265
- checkbox_trans_multi = gr.Checkbox(label='Translate to English')
266
- with gr.Column():
267
- with gr.Group():
268
- input_diarization_token_multi = gr.Textbox(label='Paste your Hugging Face token here for speaker diarization (or add it as an environment variable)', value=HF_AUTH_TOKEN)
269
- check_diarization_multi = gr.Checkbox(label='Speaker diarization')
270
- with gr.Accordion("For more details click here...", open=False):
271
- gr.Markdown("""
272
- An access token can be created [here](https://hf.co/settings/tokens)
273
 
274
- If not done yet for your account, you need to [accept segmentation terms & conditions](https://huggingface.co/pyannote/segmentation-3.0)
275
 
276
- If not done yet for your account, you need to [accept diarization terms & conditions](https://huggingface.co/pyannote/speaker-diarization-3.1)
277
- """)
278
- btn_transcribe_multi= gr.Button("Transcribe")
279
- textbox_transcribe_multi= gr.Chatbot(label='Transciption',visible=True)
280
 
281
  with gr.Tab("Device info"):
282
  gr.Markdown(device_info, label="Hardware info & installed packages")
@@ -284,6 +284,6 @@ with gr.Blocks(title="Automatic speech recognition (beta)", css=css, analytics_e
284
 
285
  transcribe_event = upl_btn.click(fn=inference, inputs=[upl_input, dropdown_model, upl_language, upl_translate, check_diarization, input_diarization_token], outputs=[textbox], concurrency_limit=1)
286
  # transcribe_files_event = btn_transcribe_folder.click(fn=process_folder, inputs=[files_source, dropdown_lang_multi, checkbox_trans_multi, input_diarization_token], outputs=[textbox_transcribe_folder], concurrency_limit=1)
287
- transcribe_files_event = btn_transcribe_multi.click(fn=process_folder, inputs=[files_source, dropdown_model_multi, dropdown_lang_multi, check_diarization_multi, checkbox_trans_multi, input_diarization_token_multi], outputs=[], concurrency_limit=1)
288
 
289
  demo.queue().launch(server_name="0.0.0.0")
 
244
  with gr.Column():
245
  textbox = gr.Textbox(label='Transciption',visible=True)
246
 
247
+ # with gr.Tab("Process multiple files"):
248
+ # files_source=gr.Files(label="Select Audio Files", file_count="multiple")
249
+ # with gr.Column():
250
+ # dropdown_model_multi = gr.Dropdown(
251
+ # label='Model',
252
+ # choices = ["openai/whisper-large-v3", "openai/whisper-medium", "openai/whisper-small", "openai/whisper-tiny"],
253
+ # value="openai/whisper-large-v3",
254
+ # info="""
255
+ # Larger models will increase the quality of the transcription, but reduce performance.
256
+ # """)
257
+ # dropdown_lang_multi = gr.Dropdown(
258
+ # label='Language',
259
+ # choices = ['Automatic detection']+sorted(list(languages.keys())),
260
+ # value='Automatic detection',
261
+ # info="""
262
+ # Setting the language to "Automatic detection" will auto-detect the language based on the first 30 seconds.
263
+ # If the language is known upfront, always set it manually.
264
+ # """)
265
+ # checkbox_trans_multi = gr.Checkbox(label='Translate to English')
266
+ # with gr.Column():
267
+ # with gr.Group():
268
+ # input_diarization_token_multi = gr.Textbox(label='Paste your Hugging Face token here for speaker diarization (or add it as an environment variable)', value=HF_AUTH_TOKEN)
269
+ # check_diarization_multi = gr.Checkbox(label='Speaker diarization')
270
+ # with gr.Accordion("For more details click here...", open=False):
271
+ # gr.Markdown("""
272
+ # An access token can be created [here](https://hf.co/settings/tokens)
273
 
274
+ # If not done yet for your account, you need to [accept segmentation terms & conditions](https://huggingface.co/pyannote/segmentation-3.0)
275
 
276
+ # If not done yet for your account, you need to [accept diarization terms & conditions](https://huggingface.co/pyannote/speaker-diarization-3.1)
277
+ # """)
278
+ # btn_transcribe_multi= gr.Button("Transcribe")
279
+ # textbox_transcribe_multi= gr.Chatbot(label='Transciption',visible=True)
280
 
281
  with gr.Tab("Device info"):
282
  gr.Markdown(device_info, label="Hardware info & installed packages")
 
284
 
285
  transcribe_event = upl_btn.click(fn=inference, inputs=[upl_input, dropdown_model, upl_language, upl_translate, check_diarization, input_diarization_token], outputs=[textbox], concurrency_limit=1)
286
  # transcribe_files_event = btn_transcribe_folder.click(fn=process_folder, inputs=[files_source, dropdown_lang_multi, checkbox_trans_multi, input_diarization_token], outputs=[textbox_transcribe_folder], concurrency_limit=1)
287
+ # transcribe_files_event = btn_transcribe_multi.click(fn=process_folder, inputs=[files_source, dropdown_model_multi, dropdown_lang_multi, check_diarization_multi, checkbox_trans_multi, input_diarization_token_multi], outputs=[], concurrency_limit=1)
288
 
289
  demo.queue().launch(server_name="0.0.0.0")