rehan953 commited on
Commit
2b113cb
·
verified ·
1 Parent(s): 621cdc6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -297,8 +297,7 @@ def run_ocr(uploaded_file):
297
  hdr = extract_pdf_text_in_band(path, page_num, 0, PDF_HEADER_BAND_FRAC)
298
  if not (hdr and hdr.strip()):
299
  hdr = ocr_zone(img_path, 0, he)
300
- # Skip header if already present in page_md (avoids duplicating body content)
301
- if hdr and hdr.strip() and hdr.strip()[:80] not in page_md:
302
  parts.append(hdr.strip())
303
 
304
  if page_md:
 
297
  hdr = extract_pdf_text_in_band(path, page_num, 0, PDF_HEADER_BAND_FRAC)
298
  if not (hdr and hdr.strip()):
299
  hdr = ocr_zone(img_path, 0, he)
300
+ if hdr and hdr.strip():
 
301
  parts.append(hdr.strip())
302
 
303
  if page_md: