Spaces:
Runtime error
Runtime error
Commit
·
1a80a66
1
Parent(s):
94592e3
add excel support
Browse files
app.py
CHANGED
|
@@ -55,6 +55,7 @@ from langchain.document_loaders import (
|
|
| 55 |
UnstructuredODTLoader,
|
| 56 |
UnstructuredPowerPointLoader,
|
| 57 |
UnstructuredWordDocumentLoader,
|
|
|
|
| 58 |
)
|
| 59 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
| 60 |
from langchain.docstore.document import Document
|
|
@@ -106,6 +107,8 @@ LOADER_MAPPING = {
|
|
| 106 |
".ppt": (UnstructuredPowerPointLoader, {}),
|
| 107 |
".pptx": (UnstructuredPowerPointLoader, {}),
|
| 108 |
".txt": (TextLoader, {"encoding": "utf8"}),
|
|
|
|
|
|
|
| 109 |
# Add more mappings for other file extensions and loaders as needed
|
| 110 |
}
|
| 111 |
|
|
|
|
| 55 |
UnstructuredODTLoader,
|
| 56 |
UnstructuredPowerPointLoader,
|
| 57 |
UnstructuredWordDocumentLoader,
|
| 58 |
+
UnstructuredExcelLoader
|
| 59 |
)
|
| 60 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
| 61 |
from langchain.docstore.document import Document
|
|
|
|
| 107 |
".ppt": (UnstructuredPowerPointLoader, {}),
|
| 108 |
".pptx": (UnstructuredPowerPointLoader, {}),
|
| 109 |
".txt": (TextLoader, {"encoding": "utf8"}),
|
| 110 |
+
".xls": (UnstructuredExcelLoader, {}),
|
| 111 |
+
".xlsx": (UnstructuredExcelLoader, {"mode":"elements"}),
|
| 112 |
# Add more mappings for other file extensions and loaders as needed
|
| 113 |
}
|
| 114 |
|