Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,8 +30,7 @@ def ocr_image(image, keyword=""):
|
|
| 30 |
# Retrieve text from the image
|
| 31 |
results = RAG.search("Extract all text from this image", k=1)
|
| 32 |
|
| 33 |
-
|
| 34 |
-
output_text = results[0].get('text', '')
|
| 35 |
|
| 36 |
if keyword:
|
| 37 |
keyword_lower = keyword.lower()
|
|
|
|
| 30 |
# Retrieve text from the image
|
| 31 |
results = RAG.search("Extract all text from this image", k=1)
|
| 32 |
|
| 33 |
+
output_text = results[0].text if results else ''
|
|
|
|
| 34 |
|
| 35 |
if keyword:
|
| 36 |
keyword_lower = keyword.lower()
|