Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
36 |
-
|
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 |
|