ikraamkb commited on
Commit
a0f361a
·
verified ·
1 Parent(s): 29f74d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -22,8 +22,9 @@ app = FastAPI()
22
  # Document Extraction Utils
23
  # -------------------------
24
  def extract_text_from_pdf(file):
25
- text = ""
26
  with fitz.open(stream=file.read(), filetype="pdf") as doc:
 
27
  for page in doc:
28
  text += page.get_text()
29
  return text
 
22
  # Document Extraction Utils
23
  # -------------------------
24
  def extract_text_from_pdf(file):
25
+ file.seek(0) # Reset stream position to beginning
26
  with fitz.open(stream=file.read(), filetype="pdf") as doc:
27
+ text = ""
28
  for page in doc:
29
  text += page.get_text()
30
  return text