Merge pull request #2422 from open-webui/dev

fix: rag
This commit is contained in:
Timothy Jaeryang Baek 2024-05-20 04:23:20 -10:00 committed by GitHub
commit 175293fb63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View File

@ -28,6 +28,7 @@ from langchain_community.document_loaders import (
UnstructuredXMLLoader,
UnstructuredRSTLoader,
UnstructuredExcelLoader,
UnstructuredPowerPointLoader,
YoutubeLoader,
)
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",
] or file_ext in ["xls", "xlsx"]:
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 (
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
pypdf==4.2.0
docx2txt==0.8
python-pptx==0.6.23
unstructured==0.11.8
Markdown==3.6
pypandoc==1.13

View File

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