Spaces:
Runtime error
Runtime error
Add debug output to see GLM API response
Browse files
app.py
CHANGED
|
@@ -307,7 +307,9 @@ Find as many text regions as possible. Do not skip any visible text."""
|
|
| 307 |
|
| 308 |
return detections, f"Found {len(detections)} text regions"
|
| 309 |
else:
|
| 310 |
-
|
|
|
|
|
|
|
| 311 |
|
| 312 |
except Exception as e:
|
| 313 |
return None, f"Error: {str(e)}"
|
|
@@ -477,7 +479,7 @@ def translate_manga(image, source_lang, target_lang, show_boxes, apply_inpaint,
|
|
| 477 |
return None, None, status
|
| 478 |
|
| 479 |
if len(detections) == 0:
|
| 480 |
-
return image, image,
|
| 481 |
|
| 482 |
# Step 2: Create visualization
|
| 483 |
progress(0.5, desc="🎨 Creating visualization...")
|
|
|
|
| 307 |
|
| 308 |
return detections, f"Found {len(detections)} text regions"
|
| 309 |
else:
|
| 310 |
+
# Return debug info when no detections
|
| 311 |
+
debug_info = f"No text detected.\n\nDEBUG - API Response ({len(result_text)} chars):\n{result_text[:1000] if result_text else 'EMPTY RESPONSE'}"
|
| 312 |
+
return [], debug_info
|
| 313 |
|
| 314 |
except Exception as e:
|
| 315 |
return None, f"Error: {str(e)}"
|
|
|
|
| 479 |
return None, None, status
|
| 480 |
|
| 481 |
if len(detections) == 0:
|
| 482 |
+
return image, image, status # status contains debug info
|
| 483 |
|
| 484 |
# Step 2: Create visualization
|
| 485 |
progress(0.5, desc="🎨 Creating visualization...")
|