Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
322db31d
"test/srt/git@developer.sourcefind.cn:change/sglang.git" did not exist on "2187f36237eb532f7a9eab92c198ebd3571e1494"
Commit
322db31d
authored
May 20, 2024
by
Timothy J. Baek
Browse files
fix: rag
parent
056c413e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
backend/apps/rag/main.py
backend/apps/rag/main.py
+6
-0
backend/requirements.txt
backend/requirements.txt
+1
-0
src/lib/constants.ts
src/lib/constants.ts
+3
-1
No files found.
backend/apps/rag/main.py
View file @
322db31d
...
@@ -28,6 +28,7 @@ from langchain_community.document_loaders import (
...
@@ -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):
...
@@ -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
):
):
...
...
backend/requirements.txt
View file @
322db31d
...
@@ -35,6 +35,7 @@ chromadb==0.4.24
...
@@ -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
...
...
src/lib/constants.ts
View file @
322db31d
...
@@ -86,7 +86,9 @@ export const SUPPORTED_FILE_EXTENSIONS = [
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment