reab5555 commited on
Commit
fbc8c58
·
verified ·
1 Parent(s): c7fb5f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -53,6 +53,12 @@ def analyze_video(video_path, progress=gr.Progress()):
53
  visible=True),
54
  ]
55
  output_components.extend(speaker_section)
 
 
 
 
 
 
56
 
57
  # Pad with None for any missing speakers
58
  while len(output_components) < 28:
@@ -88,8 +94,11 @@ with gr.Blocks() as iface:
88
  execution_info_box = gr.Textbox(label="Transcript", value="N/A", lines=1)
89
  output_components.append(execution_info_box)
90
 
91
- for i in range(3): # Assuming maximum of 3 speakers
92
- with gr.Tab(f"Speaker {i+1}"):
 
 
 
93
  with gr.Row():
94
  output_components.extend([
95
  gr.Markdown(visible=False),
 
53
  visible=True),
54
  ]
55
  output_components.extend(speaker_section)
56
+ output_components.append(gr.update(visible=True))
57
+
58
+ # Hide unused tabs
59
+ for j in range(i, 3):
60
+ output_components.extend([gr.update(visible=False)] * 9) # Hide components
61
+ output_components.append(gr.update(visible=False)) # Hide the tab
62
 
63
  # Pad with None for any missing speakers
64
  while len(output_components) < 28:
 
94
  execution_info_box = gr.Textbox(label="Transcript", value="N/A", lines=1)
95
  output_components.append(execution_info_box)
96
 
97
+ # In the interface definition
98
+ speaker_tabs = []
99
+ for i in range(3):
100
+ with gr.Tab(f"Speaker {i+1}", visible=False) as tab:
101
+ speaker_tabs.append(tab)
102
  with gr.Row():
103
  output_components.extend([
104
  gr.Markdown(visible=False),