Spaces:
Paused
Paused
Update mainapp.py
Browse files- mainapp.py +2 -1
mainapp.py
CHANGED
|
@@ -16,7 +16,7 @@ def home():
|
|
| 16 |
# 🔥 Process single image
|
| 17 |
async def process_image(image: Image.Image, page_num: int):
|
| 18 |
prompt = """
|
| 19 |
-
Extract all text from this image and return
|
| 20 |
|
| 21 |
"""
|
| 22 |
|
|
@@ -30,6 +30,7 @@ async def process_image(image: Image.Image, page_num: int):
|
|
| 30 |
|
| 31 |
@app.post("/ocr-llm")
|
| 32 |
async def ocr_llm_endpoint(file: UploadFile = File(...)):
|
|
|
|
| 33 |
|
| 34 |
if not file.filename.lower().endswith((".pdf", ".png", ".jpg", ".jpeg")):
|
| 35 |
raise HTTPException(status_code=400, detail="File must be PDF or image")
|
|
|
|
| 16 |
# 🔥 Process single image
|
| 17 |
async def process_image(image: Image.Image, page_num: int):
|
| 18 |
prompt = """
|
| 19 |
+
Extract all text from this image and return in key value json structure.
|
| 20 |
|
| 21 |
"""
|
| 22 |
|
|
|
|
| 30 |
|
| 31 |
@app.post("/ocr-llm")
|
| 32 |
async def ocr_llm_endpoint(file: UploadFile = File(...)):
|
| 33 |
+
|
| 34 |
|
| 35 |
if not file.filename.lower().endswith((".pdf", ".png", ".jpg", ".jpeg")):
|
| 36 |
raise HTTPException(status_code=400, detail="File must be PDF or image")
|