Spaces:
Sleeping
Sleeping
Ryan
commited on
Commit
·
087a38a
1
Parent(s):
daf2b71
update
Browse files
app.py
CHANGED
@@ -112,14 +112,17 @@ def create_app():
|
|
112 |
|
113 |
# Generate visualization components
|
114 |
print("Generating visualization components...")
|
|
|
115 |
visualization_components = process_and_visualize_analysis(analysis_results)
|
116 |
|
117 |
-
return
|
|
|
|
|
118 |
except Exception as e:
|
119 |
import traceback
|
120 |
error_msg = f"Error in run_analysis: {str(e)}\n{traceback.format_exc()}"
|
121 |
print(error_msg)
|
122 |
-
return {"error": error_msg}, True, [gr.Markdown(f"**Error:**\n\n```\n{error_msg}\n```")]
|
123 |
|
124 |
# Run analysis with proper parameters
|
125 |
run_analysis_btn.click(
|
|
|
112 |
|
113 |
# Generate visualization components
|
114 |
print("Generating visualization components...")
|
115 |
+
# Instead of directly returning the components, we'll update the container
|
116 |
visualization_components = process_and_visualize_analysis(analysis_results)
|
117 |
|
118 |
+
# For the third return value, return a simple value that can trigger the update
|
119 |
+
# The actual components will be placed inside the container
|
120 |
+
return analysis_results, True, gr.update(value=visualization_components)
|
121 |
except Exception as e:
|
122 |
import traceback
|
123 |
error_msg = f"Error in run_analysis: {str(e)}\n{traceback.format_exc()}"
|
124 |
print(error_msg)
|
125 |
+
return {"error": error_msg}, True, gr.update(value=[gr.Markdown(f"**Error:**\n\n```\n{error_msg}\n```")])
|
126 |
|
127 |
# Run analysis with proper parameters
|
128 |
run_analysis_btn.click(
|