Spaces:
Sleeping
Sleeping
π Fix indentation error in app.py
Browse filesRemove duplicate try-except blocks and fix code alignment to resolve
IndentationError on line 346.
π€ Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
app.py
CHANGED
|
@@ -338,23 +338,20 @@ if current_image is not None:
|
|
| 338 |
# Clear any running status messages on error
|
| 339 |
for stage_key in stage_statuses:
|
| 340 |
stage_statuses[stage_key].empty()
|
| 341 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 342 |
|
| 343 |
st.markdown('</div>', unsafe_allow_html=True)
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
except Exception as e:
|
| 353 |
-
error_msg = f"Analysis failed: {str(e)}"
|
| 354 |
-
logger.error(error_msg)
|
| 355 |
-
logger.error(f"Full traceback: {traceback.format_exc()}")
|
| 356 |
-
st.error(error_msg)
|
| 357 |
-
st.code(traceback.format_exc())
|
| 358 |
else:
|
| 359 |
st.markdown('<div class="upload-section">', unsafe_allow_html=True)
|
| 360 |
st.markdown("**Upload an image or select a sample to begin analysis**")
|
|
|
|
| 338 |
# Clear any running status messages on error
|
| 339 |
for stage_key in stage_statuses:
|
| 340 |
stage_statuses[stage_key].empty()
|
| 341 |
+
error_msg = f"Analysis failed: {str(e)}"
|
| 342 |
+
logger.error(error_msg)
|
| 343 |
+
logger.error(f"Full traceback: {traceback.format_exc()}")
|
| 344 |
+
st.error(error_msg)
|
| 345 |
+
st.code(traceback.format_exc())
|
| 346 |
|
| 347 |
st.markdown('</div>', unsafe_allow_html=True)
|
| 348 |
+
|
| 349 |
+
# Cleanup
|
| 350 |
+
if 'temp_path' in locals() and os.path.exists(temp_path):
|
| 351 |
+
try:
|
| 352 |
+
os.remove(temp_path)
|
| 353 |
+
except:
|
| 354 |
+
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 355 |
else:
|
| 356 |
st.markdown('<div class="upload-section">', unsafe_allow_html=True)
|
| 357 |
st.markdown("**Upload an image or select a sample to begin analysis**")
|