Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -133,13 +133,13 @@ def clearKBUploadDirectory(uploads_dir):
|
|
133 |
print('Failed to delete %s. Reason: %s' % (file_path, e))
|
134 |
|
135 |
def PDFChunkerWithSeparator(filepath, separator):
|
136 |
-
# creating a pdf reader object
|
137 |
-
reader = PyPDF2.PdfReader(filepath)
|
138 |
|
139 |
-
# print the number of pages in pdf file
|
140 |
-
print(len(reader.pages))
|
141 |
content = ""
|
142 |
if filepath.endswith(".pdf"):
|
|
|
|
|
|
|
|
|
143 |
for page in reader.pages:
|
144 |
content += page.extract_text()
|
145 |
elif filepath.endswith(".txt"):
|
|
|
133 |
print('Failed to delete %s. Reason: %s' % (file_path, e))
|
134 |
|
135 |
def PDFChunkerWithSeparator(filepath, separator):
|
|
|
|
|
136 |
|
|
|
|
|
137 |
content = ""
|
138 |
if filepath.endswith(".pdf"):
|
139 |
+
# creating a pdf reader object
|
140 |
+
reader = PyPDF2.PdfReader(filepath)
|
141 |
+
# print the number of pages in pdf file
|
142 |
+
print(len(reader.pages))
|
143 |
for page in reader.pages:
|
144 |
content += page.extract_text()
|
145 |
elif filepath.endswith(".txt"):
|