pranshh commited on
Commit
c265e46
·
verified ·
1 Parent(s): 11d9b9f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
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
- # Extract text from results
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()