Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -91,10 +91,10 @@ async def run_ocr(file: UploadFile) -> str:
|
|
| 91 |
image_b64 = base64.b64encode(content).decode()
|
| 92 |
|
| 93 |
# FIX 2: Matches reference limit — base64 must be < 180,000 characters
|
| 94 |
-
if len(image_b64) >=
|
| 95 |
raise HTTPException(
|
| 96 |
status_code=413,
|
| 97 |
-
detail="Image too large (base64 must be <
|
| 98 |
)
|
| 99 |
|
| 100 |
# Payload structure matches the official reference exactly
|
|
|
|
| 91 |
image_b64 = base64.b64encode(content).decode()
|
| 92 |
|
| 93 |
# FIX 2: Matches reference limit — base64 must be < 180,000 characters
|
| 94 |
+
if len(image_b64) >= 1000_000:
|
| 95 |
raise HTTPException(
|
| 96 |
status_code=413,
|
| 97 |
+
detail="Image too large (base64 must be < 1,000,000 chars). Resize the image and try again.",
|
| 98 |
)
|
| 99 |
|
| 100 |
# Payload structure matches the official reference exactly
|