Omnibus commited on
Commit
9df3294
1 Parent(s): 1cd6491

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -28,12 +28,12 @@ client = InferenceClient(
28
 
29
  def read_pdf(pdf_path):
30
  from pypdf import PdfReader
31
-
32
  reader = PdfReader(f'{pdf_path}')
33
  number_of_pages = len(reader.pages)
34
-
35
- page = reader.pages[:-1]
36
- text = page.extract_text()
37
  print (text)
38
  return text
39
 
 
28
 
29
  def read_pdf(pdf_path):
30
  from pypdf import PdfReader
31
+ text=""
32
  reader = PdfReader(f'{pdf_path}')
33
  number_of_pages = len(reader.pages)
34
+ for i in range(number_of_pages-1):
35
+ page = reader.pages[i]
36
+ text = f'{text}\n{page.extract_text()}'
37
  print (text)
38
  return text
39