Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -147,19 +147,17 @@ Provide a concise, user-friendly interpretation of these findings in simple term
|
|
| 147 |
# Step 1: Inspect file
|
| 148 |
def preview_file(file):
|
| 149 |
msg, cols, preview = inspect_file(file)
|
| 150 |
-
|
| 151 |
-
# Add a placeholder choice for no selection
|
| 152 |
-
# This ensures the user can explicitly say "no time column"
|
| 153 |
if len(cols) > 0:
|
| 154 |
cols = ["(No time column)"] + cols
|
| 155 |
default_value = "(No time column)"
|
| 156 |
else:
|
| 157 |
-
# If no columns detected, just leave empty
|
| 158 |
cols = []
|
| 159 |
default_value = None
|
|
|
|
|
|
|
|
|
|
| 160 |
|
| 161 |
-
# Return a dictionary for the Dropdown output
|
| 162 |
-
return msg, {"choices": cols, "value": default_value}, preview
|
| 163 |
|
| 164 |
|
| 165 |
with gr.Blocks() as demo:
|
|
|
|
| 147 |
# Step 1: Inspect file
|
| 148 |
def preview_file(file):
|
| 149 |
msg, cols, preview = inspect_file(file)
|
| 150 |
+
# Add placeholder choice
|
|
|
|
|
|
|
| 151 |
if len(cols) > 0:
|
| 152 |
cols = ["(No time column)"] + cols
|
| 153 |
default_value = "(No time column)"
|
| 154 |
else:
|
|
|
|
| 155 |
cols = []
|
| 156 |
default_value = None
|
| 157 |
+
|
| 158 |
+
# Use gr.update(...) for the dropdown output
|
| 159 |
+
return msg, gr.update(choices=cols, value=default_value), preview
|
| 160 |
|
|
|
|
|
|
|
| 161 |
|
| 162 |
|
| 163 |
with gr.Blocks() as demo:
|