LAP-DEV commited on
Commit
c004d78
·
verified ·
1 Parent(s): 8b0b3c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -104,7 +104,6 @@ class App:
104
  with gr.Row():
105
  cb_timestamp_preview = gr.Checkbox(value=whisper_params["add_timestamp_preview"],label="Show preview with timestamps", interactive=True)
106
  cb_timestamp_file = gr.Checkbox(value=whisper_params["add_timestamp_file"], label="Add timestamp to filenames", interactive=True)
107
- cb_diarize = gr.Checkbox(value=diarization_params["is_diarize"],label="Use diarization",interactive=True)
108
  with gr.Column(scale=4):
109
  input_file_audio = gr.Audio(type='filepath', elem_id="audio_input", show_download_button=True, visible=True, interactive=True)
110
  input_file_video = gr.Video(elem_id="audio_input", show_download_button=True, visible=False, interactive=True)
@@ -124,6 +123,7 @@ class App:
124
  cb_translate_output = gr.Checkbox(value=translation_params["translate_output"], label="Translate to selected language", info="Translate using Facebook's NLLB",interactive=True)
125
 
126
  with gr.Accordion("Speaker diarization", open=False, visible=True):
 
127
  tb_hf_token = gr.Text(label="Token", value=diarization_params["hf_token"],info="An access token is required to use diarization & can be created [here](https://hf.co/settings/tokens). If not done yet for your account, you need to accept the terms & conditions of [diarization](https://huggingface.co/pyannote/speaker-diarization-3.1) & [segmentation](https://huggingface.co/pyannote/segmentation-3.0).")
128
  dd_diarization_device = gr.Dropdown(label="Device",
129
  choices=self.whisper_inf.diarizer.get_available_device(),
@@ -243,6 +243,8 @@ class App:
243
 
244
 
245
  #dd_model.change(fn=self.on_change_models, inputs=[dd_model], outputs=[cb_translate])
 
 
246
 
247
  return (
248
  WhisperParameters(
@@ -341,8 +343,6 @@ class App:
341
  # btn_openfolder.click(fn=lambda: self.open_folder("outputs"), inputs=None, outputs=None)
342
 
343
  input_multi.change(fn=self.update_viewer,inputs=input_multi,outputs=[input_file_audio,input_file_video,input_file_multi])
344
- cb_timestamp_preview.change(fn=self.update_dataframe,inputs=[cb_timestamp_preview,cb_diarize],outputs=tb_indicator)
345
- cb_diarize.change(fn=self.update_dataframe,inputs=[cb_timestamp_preview,cb_diarize],outputs=tb_indicator)
346
 
347
  with gr.TabItem("Device info"): # tab2
348
  with gr.Column():
 
104
  with gr.Row():
105
  cb_timestamp_preview = gr.Checkbox(value=whisper_params["add_timestamp_preview"],label="Show preview with timestamps", interactive=True)
106
  cb_timestamp_file = gr.Checkbox(value=whisper_params["add_timestamp_file"], label="Add timestamp to filenames", interactive=True)
 
107
  with gr.Column(scale=4):
108
  input_file_audio = gr.Audio(type='filepath', elem_id="audio_input", show_download_button=True, visible=True, interactive=True)
109
  input_file_video = gr.Video(elem_id="audio_input", show_download_button=True, visible=False, interactive=True)
 
123
  cb_translate_output = gr.Checkbox(value=translation_params["translate_output"], label="Translate to selected language", info="Translate using Facebook's NLLB",interactive=True)
124
 
125
  with gr.Accordion("Speaker diarization", open=False, visible=True):
126
+ cb_diarize = gr.Checkbox(value=diarization_params["is_diarize"],label="Use diarization",interactive=True)
127
  tb_hf_token = gr.Text(label="Token", value=diarization_params["hf_token"],info="An access token is required to use diarization & can be created [here](https://hf.co/settings/tokens). If not done yet for your account, you need to accept the terms & conditions of [diarization](https://huggingface.co/pyannote/speaker-diarization-3.1) & [segmentation](https://huggingface.co/pyannote/segmentation-3.0).")
128
  dd_diarization_device = gr.Dropdown(label="Device",
129
  choices=self.whisper_inf.diarizer.get_available_device(),
 
243
 
244
 
245
  #dd_model.change(fn=self.on_change_models, inputs=[dd_model], outputs=[cb_translate])
246
+ cb_timestamp_preview.change(fn=self.update_dataframe,inputs=[cb_timestamp_preview,cb_diarize],outputs=tb_indicator)
247
+ cb_diarize.change(fn=self.update_dataframe,inputs=[cb_timestamp_preview,cb_diarize],outputs=tb_indicator)
248
 
249
  return (
250
  WhisperParameters(
 
343
  # btn_openfolder.click(fn=lambda: self.open_folder("outputs"), inputs=None, outputs=None)
344
 
345
  input_multi.change(fn=self.update_viewer,inputs=input_multi,outputs=[input_file_audio,input_file_video,input_file_multi])
 
 
346
 
347
  with gr.TabItem("Device info"): # tab2
348
  with gr.Column():