Spaces:
Sleeping
Sleeping
Commit Β·
0aabca3
1
Parent(s): bd26bb3
Update Gradio code for 6.0 compatibility
Browse files
app.py
CHANGED
|
@@ -119,7 +119,7 @@ def clear_inputs():
|
|
| 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,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 |
-
|
|
|
|
| 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 |
-
|
|
|
|
|
|
| 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)
|