Update app.py
Browse files
app.py
CHANGED
@@ -340,7 +340,7 @@ class App:
|
|
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.
|
344 |
|
345 |
with gr.TabItem("Device info"): # tab2
|
346 |
with gr.Column():
|
@@ -378,7 +378,7 @@ class App:
|
|
378 |
return gr.Checkbox(visible=True, value=False, label="Translate to English", interactive=True)
|
379 |
|
380 |
@staticmethod
|
381 |
-
def
|
382 |
if radio_text == "Audio":
|
383 |
return gr.update(visible=True), gr.update(visible=False), gr.update(visible=False)
|
384 |
elif radio_text == "Video":
|
@@ -386,6 +386,19 @@ class App:
|
|
386 |
else:
|
387 |
return gr.update(visible=False), gr.update(visible=False), gr.update(visible=True)
|
388 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
# Create the parser for command-line arguments
|
390 |
parser = argparse.ArgumentParser()
|
391 |
parser.add_argument('--whisper_type', type=str, default="faster-whisper",
|
|
|
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 |
|
345 |
with gr.TabItem("Device info"): # tab2
|
346 |
with gr.Column():
|
|
|
378 |
return gr.Checkbox(visible=True, value=False, label="Translate to English", interactive=True)
|
379 |
|
380 |
@staticmethod
|
381 |
+
def update_viewer(radio_text):
|
382 |
if radio_text == "Audio":
|
383 |
return gr.update(visible=True), gr.update(visible=False), gr.update(visible=False)
|
384 |
elif radio_text == "Video":
|
|
|
386 |
else:
|
387 |
return gr.update(visible=False), gr.update(visible=False), gr.update(visible=True)
|
388 |
|
389 |
+
@staticmethod
|
390 |
+
def update_dataframe(value_cb_timestamp_preview,value_cb_diarize):
|
391 |
+
if value_cb_timestamp_preview==True and value_cb_diarize==True:
|
392 |
+
return gr.Dataframe(headers=["Time","Speaker","Text"], column_widths=["15%","15%","70%"])
|
393 |
+
elif value_cb_timestamp_preview==True and value_cb_diarize==False:
|
394 |
+
return gr.Dataframe(headers=["Time","Text"], column_widths=["15%","85%"])
|
395 |
+
elif value_cb_timestamp_preview==False and value_cb_diarize==True:
|
396 |
+
return gr.Dataframe(headers=["Speaker","Text"], column_widths=["15%","85%"])
|
397 |
+
elif value_cb_timestamp_preview==False and value_cb_diarize==False:
|
398 |
+
return gr.Dataframe(headers=[Text"], column_widths=["100%"])
|
399 |
+
else:
|
400 |
+
return gr.Dataframe(headers=[Text"], column_widths=["100%"])
|
401 |
+
|
402 |
# Create the parser for command-line arguments
|
403 |
parser = argparse.ArgumentParser()
|
404 |
parser.add_argument('--whisper_type', type=str, default="faster-whisper",
|