Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -334,14 +334,27 @@ if st.session_state.df is not None:
|
|
| 334 |
st.warning("β οΈ No Conclusion Generated.")
|
| 335 |
|
| 336 |
if conclusion_result:
|
| 337 |
-
#
|
| 338 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 339 |
# Remove any leading 'Conclusion:' in the result
|
| 340 |
cleaned_conclusion = re.sub(r'^\s*\*\*?Conclusion:?(\*\*)?\s*', '', conclusion_text, flags=re.IGNORECASE)
|
|
|
|
|
|
|
| 341 |
safe_conclusion = escape_markdown(cleaned_conclusion)
|
|
|
|
|
|
|
| 342 |
st.markdown(f"### Conclusion\n\n{safe_conclusion}")
|
| 343 |
-
|
| 344 |
-
|
|
|
|
| 345 |
|
| 346 |
|
| 347 |
# Full Data Visualization Tab
|
|
|
|
| 334 |
st.warning("β οΈ No Conclusion Generated.")
|
| 335 |
|
| 336 |
if conclusion_result:
|
| 337 |
+
# Check if conclusion_result is a dictionary or list
|
| 338 |
+
if isinstance(conclusion_result, dict):
|
| 339 |
+
# Assuming the actual conclusion is inside a 'content' or similar key
|
| 340 |
+
conclusion_text = conclusion_result.get('content', '')
|
| 341 |
+
elif isinstance(conclusion_result, list):
|
| 342 |
+
# If it's a list, join all items into a single string
|
| 343 |
+
conclusion_text = " ".join(map(str, conclusion_result))
|
| 344 |
+
else:
|
| 345 |
+
conclusion_text = str(conclusion_result)
|
| 346 |
+
|
| 347 |
# Remove any leading 'Conclusion:' in the result
|
| 348 |
cleaned_conclusion = re.sub(r'^\s*\*\*?Conclusion:?(\*\*)?\s*', '', conclusion_text, flags=re.IGNORECASE)
|
| 349 |
+
|
| 350 |
+
# Escape markdown characters
|
| 351 |
safe_conclusion = escape_markdown(cleaned_conclusion)
|
| 352 |
+
|
| 353 |
+
# Display the clean conclusion
|
| 354 |
st.markdown(f"### Conclusion\n\n{safe_conclusion}")
|
| 355 |
+
else:
|
| 356 |
+
st.warning("β οΈ No Conclusion Generated.")
|
| 357 |
+
|
| 358 |
|
| 359 |
|
| 360 |
# Full Data Visualization Tab
|