Spaces:
Sleeping
Sleeping
Update file_processing.py
Browse files- file_processing.py +4 -4
file_processing.py
CHANGED
@@ -33,13 +33,13 @@ import tempfile
|
|
33 |
from langchain.docstore.document import Document
|
34 |
|
35 |
def read_pdf(file_path: str) -> str:
|
36 |
-
loader=
|
37 |
-
text
|
38 |
return text
|
39 |
|
40 |
def read_docx(file_path: str) -> str:
|
41 |
-
loader
|
42 |
-
text
|
43 |
return text
|
44 |
|
45 |
def read_csv(file_path: str) -> str:
|
|
|
33 |
from langchain.docstore.document import Document
|
34 |
|
35 |
def read_pdf(file_path: str) -> str:
|
36 |
+
loader=PyMuPDFLoader(file_path)
|
37 |
+
text=loader.load()
|
38 |
return text
|
39 |
|
40 |
def read_docx(file_path: str) -> str:
|
41 |
+
loader=Docx2txtLoader(file_path)
|
42 |
+
text=loader.load()
|
43 |
return text
|
44 |
|
45 |
def read_csv(file_path: str) -> str:
|