tjhalanigrid commited on
Commit
0aabca3
Β·
1 Parent(s): bd26bb3

Update Gradio code for 6.0 compatibility

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -119,7 +119,7 @@ def clear_inputs():
119
  # BEAUTIFUL UI LAYOUT
120
  # =========================
121
 
122
- # 1. Custom Theme definition (FIXED: Removed button_shadow)
123
  custom_theme = gr.themes.Soft(
124
  primary_hue="indigo",
125
  secondary_hue="blue",
@@ -146,7 +146,8 @@ custom_css = """
146
  .execute-btn:hover { background: linear-gradient(90deg, #4338ca, #2563eb) !important; transform: scale(1.02); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
147
  """
148
 
149
- with gr.Blocks(theme=custom_theme, css=custom_css, title="AI Data Analyst") as demo:
 
150
 
151
  # --- HEADER WITH REPORT LINK ---
152
  gr.HTML("""
@@ -216,11 +217,11 @@ with gr.Blocks(theme=custom_theme, css=custom_css, title="AI Data Analyst") as d
216
  # Using a Tabbed layout makes the right side cleaner
217
  with gr.Tabs():
218
  with gr.TabItem("πŸ“‹ Data Table"):
 
219
  result_table = gr.Dataframe(
220
  label="Query Result Table",
221
  interactive=False,
222
- wrap=True,
223
- height=350 # Fixes height so UI doesn't jump aggressively
224
  )
225
  with gr.TabItem("πŸ” Execution Analysis"):
226
  explanation = gr.Textbox(label="Agent Details", lines=10, interactive=False)
@@ -247,4 +248,5 @@ with gr.Blocks(theme=custom_theme, css=custom_css, title="AI Data Analyst") as d
247
  )
248
 
249
  if __name__ == "__main__":
250
- demo.launch()
 
 
119
  # BEAUTIFUL UI LAYOUT
120
  # =========================
121
 
122
+ # 1. Custom Theme definition
123
  custom_theme = gr.themes.Soft(
124
  primary_hue="indigo",
125
  secondary_hue="blue",
 
146
  .execute-btn:hover { background: linear-gradient(90deg, #4338ca, #2563eb) !important; transform: scale(1.02); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
147
  """
148
 
149
+ # πŸš€ FIX 1: Removed theme and css from Blocks()
150
+ with gr.Blocks(title="AI Data Analyst") as demo:
151
 
152
  # --- HEADER WITH REPORT LINK ---
153
  gr.HTML("""
 
217
  # Using a Tabbed layout makes the right side cleaner
218
  with gr.Tabs():
219
  with gr.TabItem("πŸ“‹ Data Table"):
220
+ # πŸš€ FIX 2: Removed the unsupported 'height' parameter
221
  result_table = gr.Dataframe(
222
  label="Query Result Table",
223
  interactive=False,
224
+ wrap=True
 
225
  )
226
  with gr.TabItem("πŸ” Execution Analysis"):
227
  explanation = gr.Textbox(label="Agent Details", lines=10, interactive=False)
 
248
  )
249
 
250
  if __name__ == "__main__":
251
+ # πŸš€ FIX 3: Moved theme and css into launch()
252
+ demo.launch(theme=custom_theme, css=custom_css)