Update app.py
Browse files337 unmodified lines33833934034134234334434434534634740 unmodified lines3883893903913923913923933945 unmodified lines400401402403404405406407408409337 unmodified lines btn_run.click(fn=self.whisper_inf.transcribe_file, inputs=params + whisper_params.as_list(), outputs=[tb_indicator, files_subtitles, tb_info]) btn_run.click(fn=self.update_dataframe2,inputs=tb_indicator,outputs=tb_indicator) # btn_openfolder.click(fn=lambda: self.open_folder("outputs"), inputs=None, outputs=None)
input_multi.change(fn=self.update_viewer,inputs=input_multi,outputs=[input_file_audio,input_file_video,input_file_multi]) cb_timestamp_preview.change(fn=self.update_dataframe,inputs=cb_timestamp_preview,outputs=tb_indicator) with gr.TabItem("Device info"): # tab2 with gr.Column():40 unmodified lines return gr.update(visible=False), gr.update(visible=False), gr.update(visible=True)
@staticmethod def update_dataframe(value_cb_timestamp_preview): value_cb_diarize = False def update_dataframe(value_cb_timestamp_preview,value_cb_diarize): if value_cb_timestamp_preview==True and value_cb_diarize==True: return gr.Dataframe(headers=["Time","Speaker","Text"], column_widths=["15%","15%","70%"]) elif value_cb_timestamp_preview==True and value_cb_diarize==False:5 unmodified lines else: return gr.Dataframe(headers=["Text"], column_widths=["100%"])
@staticmethod def update_dataframe2(input_value): return gr.Dataframe(headers=["Time","Text"], column_widths=["15%","85%"])
# Create the parser for command-line argumentsparser = argparse.ArgumentParser()parser.add_argument('--whisper_type', type=str, default="faster-whisper",app.py+6-3