Spaces:
Build error
Build error
Update pages/utils.py
Browse files- pages/utils.py +4 -5
pages/utils.py
CHANGED
|
@@ -8,14 +8,13 @@ from langchain.document_loaders.sitemap import SitemapLoader
|
|
| 8 |
|
| 9 |
def read_pdf_data(pdf):
|
| 10 |
|
| 11 |
-
|
| 12 |
text = ""
|
| 13 |
-
for page in
|
| 14 |
-
text +=page.
|
| 15 |
-
|
| 16 |
-
|
| 17 |
return text
|
| 18 |
|
|
|
|
| 19 |
def split_data(docs):
|
| 20 |
|
| 21 |
text_splitter = RecursiveCharacterTextSplitter(
|
|
|
|
| 8 |
|
| 9 |
def read_pdf_data(pdf):
|
| 10 |
|
| 11 |
+
pdf_page = PdfReader(pdf_file)
|
| 12 |
text = ""
|
| 13 |
+
for page in pdf_page.pages:
|
| 14 |
+
text += page.extract_text()
|
|
|
|
|
|
|
| 15 |
return text
|
| 16 |
|
| 17 |
+
|
| 18 |
def split_data(docs):
|
| 19 |
|
| 20 |
text_splitter = RecursiveCharacterTextSplitter(
|