This commit is contained in:
Timothy J. Baek 2024-05-20 07:22:43 -07:00
parent 056c413e23
commit 322db31dc9
3 changed files with 10 additions and 1 deletions

View File

@ -28,6 +28,7 @@ from langchain_community.document_loaders import (
UnstructuredXMLLoader, UnstructuredXMLLoader,
UnstructuredRSTLoader, UnstructuredRSTLoader,
UnstructuredExcelLoader, UnstructuredExcelLoader,
UnstructuredPowerPointLoader,
YoutubeLoader, YoutubeLoader,
) )
from langchain.text_splitter import RecursiveCharacterTextSplitter from langchain.text_splitter import RecursiveCharacterTextSplitter
@ -768,6 +769,11 @@ def get_loader(filename: str, file_content_type: str, file_path: str):
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
] or file_ext in ["xls", "xlsx"]: ] or file_ext in ["xls", "xlsx"]:
loader = UnstructuredExcelLoader(file_path) loader = UnstructuredExcelLoader(file_path)
elif file_content_type in [
"application/vnd.ms-powerpoint",
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
] or file_ext in ["ppt", "pptx"]:
loader = UnstructuredPowerPointLoader(file_path)
elif file_ext in known_source_ext or ( elif file_ext in known_source_ext or (
file_content_type and file_content_type.find("text/") >= 0 file_content_type and file_content_type.find("text/") >= 0
): ):

View File

@ -35,6 +35,7 @@ chromadb==0.4.24
sentence-transformers==2.7.0 sentence-transformers==2.7.0
pypdf==4.2.0 pypdf==4.2.0
docx2txt==0.8 docx2txt==0.8
python-pptx==0.6.23
unstructured==0.11.8 unstructured==0.11.8
Markdown==3.6 Markdown==3.6
pypandoc==1.13 pypandoc==1.13

View File

@ -86,7 +86,9 @@ export const SUPPORTED_FILE_EXTENSIONS = [
'csv', 'csv',
'txt', 'txt',
'xls', 'xls',
'xlsx' 'xlsx',
'pptx',
'ppt'
]; ];
// Source: https://kit.svelte.dev/docs/modules#$env-static-public // Source: https://kit.svelte.dev/docs/modules#$env-static-public