LAP-DEV commited on
Commit
4bfc3ce
·
verified ·
1 Parent(s): aa05b82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -328,7 +328,7 @@ class App:
328
  with gr.Row():
329
  with gr.Column(scale=4):
330
  #tb_indicator = gr.Textbox(label="Output preview (Always review output generated by AI models)", show_copy_button=True, show_label=True)
331
- tb_indicator = gr.Dataframe(label="Output preview (Always review output generated by AI models)", headers=["Time","Speaker","Text"], show_search="search", wrap=True, show_label=True, show_copy_button=True, show_fullscreen_button=True, interactive=False)
332
  with gr.Column(scale=1):
333
  tb_info = gr.Textbox(label="Output info", interactive=False, show_copy_button=True)
334
  files_subtitles = gr.Files(label="Output data", interactive=False, file_count="multiple")
@@ -391,16 +391,20 @@ class App:
391
  @staticmethod
392
  def update_dataframe(value_cb_timestamp_preview,value_cb_diarize):
393
  if value_cb_timestamp_preview==True and value_cb_diarize==True:
394
- return gr.Dataframe(headers=["Time","Speaker","Text"],column_widths=["10%","10%","80%"])
395
  elif value_cb_timestamp_preview==True and value_cb_diarize==False:
396
- return gr.Dataframe(headers=["Time","Text"],column_widths=["10%","90%"])
397
  elif value_cb_timestamp_preview==False and value_cb_diarize==True:
398
- return gr.Dataframe(headers=["Speaker","Text"],column_widths=["10%","90%"])
399
  elif value_cb_timestamp_preview==False and value_cb_diarize==False:
400
- return gr.Dataframe(headers=["Text"],column_widths=["100%"])
401
  else:
402
- return gr.Dataframe(headers=["Text"],column_widths=["100%"])
403
 
 
 
 
 
404
 
405
  # Create the parser for command-line arguments
406
  parser = argparse.ArgumentParser()
 
328
  with gr.Row():
329
  with gr.Column(scale=4):
330
  #tb_indicator = gr.Textbox(label="Output preview (Always review output generated by AI models)", show_copy_button=True, show_label=True)
331
+ tb_indicator = gr.Dataframe(label="Output preview (Always review output generated by AI models)", headers=[""], show_search="search", wrap=True, show_label=True, show_copy_button=True, show_fullscreen_button=True, interactive=False)
332
  with gr.Column(scale=1):
333
  tb_info = gr.Textbox(label="Output info", interactive=False, show_copy_button=True)
334
  files_subtitles = gr.Files(label="Output data", interactive=False, file_count="multiple")
 
391
  @staticmethod
392
  def update_dataframe(value_cb_timestamp_preview,value_cb_diarize):
393
  if value_cb_timestamp_preview==True and value_cb_diarize==True:
394
+ return gr.Dataframe(headers=["Time","Speaker","Text"],column_widths=["10%","10%","79%"])
395
  elif value_cb_timestamp_preview==True and value_cb_diarize==False:
396
+ return gr.Dataframe(headers=["Time","Text"],column_widths=["10%","89%"])
397
  elif value_cb_timestamp_preview==False and value_cb_diarize==True:
398
+ return gr.Dataframe(headers=["Speaker","Text"],column_widths=["10%","89%"])
399
  elif value_cb_timestamp_preview==False and value_cb_diarize==False:
400
+ return gr.Dataframe(headers=["Text"],column_widths=["99%"])
401
  else:
402
+ return gr.Dataframe(headers=["Text"],column_widths=["99%"])
403
 
404
+ @staticmethod
405
+ def get_transcription(input_params):
406
+ gr.Dataframe, gr.Files, gr.textbox = self.whisper_inf.transcribe_file(input_params)
407
+ return gr.Dataframe, gr.Files, gr.textbox
408
 
409
  # Create the parser for command-line arguments
410
  parser = argparse.ArgumentParser()