LAP-DEV commited on
Commit
7c9313a
·
verified ·
1 Parent(s): eb294c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -338,10 +338,10 @@ class App:
338
  btn_run.click(fn=self.whisper_inf.transcribe_file,
339
  inputs=params + whisper_params.as_list(),
340
  outputs=[tb_indicator, files_subtitles, tb_info])
 
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,outputs=tb_indicator)
345
 
346
  with gr.TabItem("Device info"): # tab2
347
  with gr.Column():
@@ -388,8 +388,7 @@ class App:
388
  return gr.update(visible=False), gr.update(visible=False), gr.update(visible=True)
389
 
390
  @staticmethod
391
- def update_dataframe(value_cb_timestamp_preview):
392
- value_cb_diarize = False
393
  if value_cb_timestamp_preview==True and value_cb_diarize==True:
394
  return gr.Dataframe(headers=["Time","Speaker","Text"], column_widths=["15%","15%","70%"])
395
  elif value_cb_timestamp_preview==True and value_cb_diarize==False:
@@ -401,6 +400,10 @@ class App:
401
  else:
402
  return gr.Dataframe(headers=["Text"], column_widths=["100%"])
403
 
 
 
 
 
404
  # Create the parser for command-line arguments
405
  parser = argparse.ArgumentParser()
406
  parser.add_argument('--whisper_type', type=str, default="faster-whisper",
 
338
  btn_run.click(fn=self.whisper_inf.transcribe_file,
339
  inputs=params + whisper_params.as_list(),
340
  outputs=[tb_indicator, files_subtitles, tb_info])
341
+ btn_run.click(fn=self.update_dataframe2,inputs=tb_indicator,outputs=tb_indicator)
342
  # btn_openfolder.click(fn=lambda: self.open_folder("outputs"), inputs=None, outputs=None)
343
 
344
  input_multi.change(fn=self.update_viewer,inputs=input_multi,outputs=[input_file_audio,input_file_video,input_file_multi])
 
345
 
346
  with gr.TabItem("Device info"): # tab2
347
  with gr.Column():
 
388
  return gr.update(visible=False), gr.update(visible=False), gr.update(visible=True)
389
 
390
  @staticmethod
391
+ def update_dataframe(value_cb_timestamp_preview,value_cb_diarize):
 
392
  if value_cb_timestamp_preview==True and value_cb_diarize==True:
393
  return gr.Dataframe(headers=["Time","Speaker","Text"], column_widths=["15%","15%","70%"])
394
  elif value_cb_timestamp_preview==True and value_cb_diarize==False:
 
400
  else:
401
  return gr.Dataframe(headers=["Text"], column_widths=["100%"])
402
 
403
+ @staticmethod
404
+ def update_dataframe2(input_value):
405
+ return gr.Dataframe(headers=["Time","Text"], column_widths=["15%","85%"])
406
+
407
  # Create the parser for command-line arguments
408
  parser = argparse.ArgumentParser()
409
  parser.add_argument('--whisper_type', type=str, default="faster-whisper",