Update app.py
Browse files
app.py
CHANGED
@@ -335,7 +335,7 @@ class App:
|
|
335 |
files_subtitles = gr.Files(label="Output data", interactive=False, file_count="multiple")
|
336 |
# btn_openfolder = gr.Button('📂', scale=1)
|
337 |
|
338 |
-
tb_indicator = gr.Dataframe(label="Output preview (Always review output generated by AI models)", headers=[""], show_search="search", wrap=True, line_breaks=True, show_label=True, show_copy_button=True, show_fullscreen_button=True, interactive=False)
|
339 |
|
340 |
|
341 |
params = [input_file_audio, input_file_video, input_file_multi, input_multi, tb_input_folder, dd_file_format, cb_timestamp_file, cb_translate_output, dd_translate_model, dd_target_lang, cb_timestamp_preview, cb_diarize]
|
@@ -343,7 +343,6 @@ class App:
|
|
343 |
btn_run.click(fn=self.whisper_inf.transcribe_file,
|
344 |
inputs=params + whisper_params.as_list(),
|
345 |
outputs=[tb_indicator, files_subtitles, tb_info])
|
346 |
-
# btn_run.click(fn=self.update_dataframe,inputs=[cb_timestamp_preview,cb_diarize],outputs=tb_indicator)
|
347 |
# btn_openfolder.click(fn=lambda: self.open_folder("outputs"), inputs=None, outputs=None)
|
348 |
|
349 |
input_multi.change(fn=self.update_viewer,inputs=input_multi,outputs=[input_file_audio,input_file_video,input_file_multi])
|
@@ -392,20 +391,6 @@ class App:
|
|
392 |
else:
|
393 |
return gr.update(visible=False), gr.update(visible=False), gr.update(visible=True)
|
394 |
|
395 |
-
@staticmethod
|
396 |
-
def update_dataframe(value_cb_timestamp_preview,value_cb_diarize,value_input_multi):
|
397 |
-
|
398 |
-
if value_cb_timestamp_preview==True and value_cb_diarize==True:
|
399 |
-
return gr.Dataframe(headers=["Time","Speaker","Text"],column_widths=["10%","15%","70%"],datatype=["str","str","markdown"])
|
400 |
-
elif value_cb_timestamp_preview==True and value_cb_diarize==False:
|
401 |
-
return gr.Dataframe(headers=["Time","Text"],column_widths=["10%","85%"],datatype=["str","markdown"])
|
402 |
-
elif value_cb_timestamp_preview==False and value_cb_diarize==True:
|
403 |
-
return gr.Dataframe(headers=["Speaker","Text"],column_widths=["15%","80%"],datatype=["str","markdown"])
|
404 |
-
elif value_cb_timestamp_preview==False and value_cb_diarize==False:
|
405 |
-
return gr.Dataframe(headers=["Text"],column_widths=["95%"],datatype=["markdown"])
|
406 |
-
else:
|
407 |
-
return gr.Dataframe(headers=["Text"],column_widths=["95%"],datatype=["markdown"])
|
408 |
-
|
409 |
# Create the parser for command-line arguments
|
410 |
parser = argparse.ArgumentParser()
|
411 |
parser.add_argument('--whisper_type', type=str, default="faster-whisper",
|
|
|
335 |
files_subtitles = gr.Files(label="Output data", interactive=False, file_count="multiple")
|
336 |
# btn_openfolder = gr.Button('📂', scale=1)
|
337 |
|
338 |
+
tb_indicator = gr.Dataframe(label="Output preview (Always review output generated by AI models)", headers=[""], show_search="search", wrap=True, line_breaks=True, show_label=True, show_copy_button=True, show_fullscreen_button=True, interactive=False, elem_id="md_disclaimer")
|
339 |
|
340 |
|
341 |
params = [input_file_audio, input_file_video, input_file_multi, input_multi, tb_input_folder, dd_file_format, cb_timestamp_file, cb_translate_output, dd_translate_model, dd_target_lang, cb_timestamp_preview, cb_diarize]
|
|
|
343 |
btn_run.click(fn=self.whisper_inf.transcribe_file,
|
344 |
inputs=params + whisper_params.as_list(),
|
345 |
outputs=[tb_indicator, files_subtitles, tb_info])
|
|
|
346 |
# btn_openfolder.click(fn=lambda: self.open_folder("outputs"), inputs=None, outputs=None)
|
347 |
|
348 |
input_multi.change(fn=self.update_viewer,inputs=input_multi,outputs=[input_file_audio,input_file_video,input_file_multi])
|
|
|
391 |
else:
|
392 |
return gr.update(visible=False), gr.update(visible=False), gr.update(visible=True)
|
393 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
394 |
# Create the parser for command-line arguments
|
395 |
parser = argparse.ArgumentParser()
|
396 |
parser.add_argument('--whisper_type', type=str, default="faster-whisper",
|