LAP-DEV commited on
Commit
0419a0c
·
verified ·
1 Parent(s): 09b4189

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -96,6 +96,8 @@ class App:
96
  dd_model = gr.Dropdown(choices=self.whisper_inf.available_models, value=whisper_params["model_size"],label="Model", info="Larger models will increase the quality of the transcription, but reduce performance")
97
  dd_lang = gr.Dropdown(choices=["Automatic Detection"] + self.whisper_inf.available_langs,value=whisper_params["lang"], label="Language", info="If the language is known upfront, always set it manually")
98
  #dd_file_format = gr.Dropdown(choices=["SRT", "WebVTT", "txt"], value="SRT", label="File Format")
 
 
99
  cb_translate = gr.Checkbox(value=whisper_params["is_translate"], label="Translate to English",interactive=True)
100
  cb_timestamp = gr.Checkbox(value=whisper_params["add_timestamp"], label="Add timestamp to output file",interactive=True, visible=False)
101
  dd_file_format = gr.Dropdown(choices=["TXT","SRT"], value="TXT", label="Output format", visible=False, info="Output preview format")
@@ -290,6 +292,10 @@ class App:
290
  with gr.Column():
291
  gr.Markdown(device_info, label="Hardware info & installed packages")
292
 
 
 
 
 
293
  # Launch the app with optional gradio settings
294
  args = self.args
295
 
@@ -321,6 +327,10 @@ class App:
321
  else:
322
  return gr.Checkbox(visible=True, value=False, label="Translate to English", interactive=True)
323
 
 
 
 
 
324
 
325
  # Create the parser for command-line arguments
326
  parser = argparse.ArgumentParser()
 
96
  dd_model = gr.Dropdown(choices=self.whisper_inf.available_models, value=whisper_params["model_size"],label="Model", info="Larger models will increase the quality of the transcription, but reduce performance")
97
  dd_lang = gr.Dropdown(choices=["Automatic Detection"] + self.whisper_inf.available_langs,value=whisper_params["lang"], label="Language", info="If the language is known upfront, always set it manually")
98
  #dd_file_format = gr.Dropdown(choices=["SRT", "WebVTT", "txt"], value="SRT", label="File Format")
99
+
100
+ with gr.Row():
101
  cb_translate = gr.Checkbox(value=whisper_params["is_translate"], label="Translate to English",interactive=True)
102
  cb_timestamp = gr.Checkbox(value=whisper_params["add_timestamp"], label="Add timestamp to output file",interactive=True, visible=False)
103
  dd_file_format = gr.Dropdown(choices=["TXT","SRT"], value="TXT", label="Output format", visible=False, info="Output preview format")
 
292
  with gr.Column():
293
  gr.Markdown(device_info, label="Hardware info & installed packages")
294
 
295
+ with gr.TabItem("Advanced settings"): # tab3
296
+ cb_diarize_show = gr.Checkbox(value=False, label="Enable speaker diarization options",interactive=True)
297
+ cb_diarize_show.change(fn=self.on_diarize_show)
298
+
299
  # Launch the app with optional gradio settings
300
  args = self.args
301
 
 
327
  else:
328
  return gr.Checkbox(visible=True, value=False, label="Translate to English", interactive=True)
329
 
330
+ @staticmethod
331
+ def on_diarize_show():
332
+ gr.Accordion("Diarization options", open=False, visible=cb_diarize_show)
333
+
334
 
335
  # Create the parser for command-line arguments
336
  parser = argparse.ArgumentParser()