Hk4crprasad commited on
Commit
9d3f21f
·
verified ·
1 Parent(s): f9d374c

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -457,15 +457,15 @@ history=[
457
  "role": "model"
458
  },
459
  ]
 
460
  def get_pdf_text(pdf_docs):
461
- text=""
462
  for pdf in pdf_docs:
463
- pdf_reader= PdfReader(pdf)
 
464
  for page in pdf_reader.pages:
465
- text+= page.extract_text()
466
- return text
467
-
468
-
469
 
470
  def get_text_chunks(text):
471
  text_splitter = RecursiveCharacterTextSplitter(chunk_size=10000, chunk_overlap=1000)
 
457
  "role": "model"
458
  },
459
  ]
460
+
461
  def get_pdf_text(pdf_docs):
462
+ text = ""
463
  for pdf in pdf_docs:
464
+ pdf.seek(0)
465
+ pdf_reader = PdfReader(pdf.read()) # Read the content in binary mode
466
  for page in pdf_reader.pages:
467
+ text += page.extract_text()
468
+ return text
 
 
469
 
470
  def get_text_chunks(text):
471
  text_splitter = RecursiveCharacterTextSplitter(chunk_size=10000, chunk_overlap=1000)