stackConsult commited on
Commit
c031a73
·
verified ·
1 Parent(s): 46a1acf

Add missing Gradio UI components and demo.launch() to complete app initialization

Browse files

CRITICAL FIX: Resolved "application does not seem to be initialized" runtime error.

Root Cause: After fixing the indentation errors, the app.py file was missing the Gradio UI implementation inside the `with gr.Blocks()` context. The file ended at line 161 with just data variable declarations, but had no UI components or launch statement.

Changes Made:
- Added tabbed interface using gr.Tabs() with 4 tabs:
1. Consent/Event Audit tab
2. Cadence Branching Composer tab
3. Live Diagnostics tab
4. Audit Trail Export tab
- Each tab calls its corresponding panel function with sample data
- Added `if __name__ == "__main__":` block with `demo.launch()` to properly initialize and start the Gradio application

This completes the application structure and should resolve the initialization error.

Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -158,4 +158,21 @@ diagnostics_sample = [
158
  }
159
  ]
160
 
161
- audit_history_sample = consent_events_sample
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  }
159
  ]
160
 
161
+ audit_history_sample = consent_events_sample
162
+
163
+ # Create tabbed interface
164
+ with gr.Tabs():
165
+ with gr.Tab("Consent/Event Audit"):
166
+ consent_audit_panel(consent_events_sample)
167
+
168
+ with gr.Tab("Cadence Branching Composer"):
169
+ branching_composer(branches_sample)
170
+
171
+ with gr.Tab("Live Diagnostics"):
172
+ diagnostics_panel(diagnostics_sample)
173
+
174
+ with gr.Tab("Audit Trail Export"):
175
+ audit_trail_widget(audit_history_sample)
176
+
177
+ if __name__ == "__main__":
178
+ demo.launch()