Update app.py
Browse files
app.py
CHANGED
@@ -302,9 +302,9 @@ class App:
|
|
302 |
with gr.TabItem("Audio upload/record"): # tab1
|
303 |
|
304 |
with gr.Row():
|
305 |
-
with gr.Column():
|
306 |
-
input_multi = gr.Radio(["Single", "
|
307 |
-
with gr.Column():
|
308 |
input_file = gr.Audio(type='filepath', elem_id="audio_input", show_download_button=True, visible=True)
|
309 |
input_file_multi = gr.Files(label="Upload one or more audio/video files here", elem_id="audio_input", type='filepath', file_count="multiple", file_types=["audio","video"], visible=False)
|
310 |
|
@@ -335,7 +335,7 @@ class App:
|
|
335 |
outputs=[tb_indicator, files_subtitles, tb_info])
|
336 |
# btn_openfolder.click(fn=lambda: self.open_folder("outputs"), inputs=None, outputs=None)
|
337 |
|
338 |
-
input_multi.change(fn=self.update_visibility,inputs=input_multi)
|
339 |
|
340 |
with gr.TabItem("Device info"): # tab2
|
341 |
with gr.Column():
|
@@ -375,11 +375,9 @@ class App:
|
|
375 |
@staticmethod
|
376 |
def update_visibility(radio_text: str):
|
377 |
if radio_text == "Single":
|
378 |
-
|
379 |
-
input_file_multi.visible = False
|
380 |
else:
|
381 |
-
|
382 |
-
input_file_multi.visible = True
|
383 |
|
384 |
# Create the parser for command-line arguments
|
385 |
parser = argparse.ArgumentParser()
|
|
|
302 |
with gr.TabItem("Audio upload/record"): # tab1
|
303 |
|
304 |
with gr.Row():
|
305 |
+
with gr.Column(scale=1):
|
306 |
+
input_multi = gr.Radio(["Single", "Multiple"], label="Process one or multiple files", value="Single")
|
307 |
+
with gr.Column(scale=4):
|
308 |
input_file = gr.Audio(type='filepath', elem_id="audio_input", show_download_button=True, visible=True)
|
309 |
input_file_multi = gr.Files(label="Upload one or more audio/video files here", elem_id="audio_input", type='filepath', file_count="multiple", file_types=["audio","video"], visible=False)
|
310 |
|
|
|
335 |
outputs=[tb_indicator, files_subtitles, tb_info])
|
336 |
# btn_openfolder.click(fn=lambda: self.open_folder("outputs"), inputs=None, outputs=None)
|
337 |
|
338 |
+
input_multi.change(fn=self.update_visibility,inputs=input_multi,outputs=[input_file.visible,input_file_multi.visible])
|
339 |
|
340 |
with gr.TabItem("Device info"): # tab2
|
341 |
with gr.Column():
|
|
|
375 |
@staticmethod
|
376 |
def update_visibility(radio_text: str):
|
377 |
if radio_text == "Single":
|
378 |
+
return True, False
|
|
|
379 |
else:
|
380 |
+
return False, True
|
|
|
381 |
|
382 |
# Create the parser for command-line arguments
|
383 |
parser = argparse.ArgumentParser()
|