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
cf6b3fa4
"git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "27d5eb46847f71e0ec15c437c1064b950fca32fe"
Commit
cf6b3fa4
authored
Jan 17, 2024
by
Marclass
Browse files
remove html type and add js/css
parent
43d84666
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
backend/apps/rag/main.py
backend/apps/rag/main.py
+5
-2
No files found.
backend/apps/rag/main.py
View file @
cf6b3fa4
...
@@ -149,16 +149,17 @@ def store_doc(
...
@@ -149,16 +149,17 @@ def store_doc(
"text/plain"
,
"text/plain"
,
"text/csv"
,
"text/csv"
,
"text/xml"
,
"text/xml"
,
"text/html"
,
"text/x-python"
,
"text/x-python"
,
"text/css"
,
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
,
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
,
"application/octet-stream"
,
"application/octet-stream"
,
"application/x-javascript"
,
]:
]:
raise
HTTPException
(
raise
HTTPException
(
status_code
=
status
.
HTTP_400_BAD_REQUEST
,
status_code
=
status
.
HTTP_400_BAD_REQUEST
,
detail
=
ERROR_MESSAGES
.
FILE_NOT_SUPPORTED
,
detail
=
ERROR_MESSAGES
.
FILE_NOT_SUPPORTED
,
)
)
text_xml
=
[
"text/html"
,
"text/xml"
]
text_xml
=
[
"text/xml"
]
octet_markdown
=
[
"md"
]
octet_markdown
=
[
"md"
]
octet_plain
=
[
octet_plain
=
[
"go"
,
"py"
,
"java"
,
"sh"
,
"bat"
,
"ps1"
,
"cmd"
,
"js"
,
"go"
,
"py"
,
"java"
,
"sh"
,
"bat"
,
"ps1"
,
"cmd"
,
"js"
,
...
@@ -206,6 +207,8 @@ def store_doc(
...
@@ -206,6 +207,8 @@ def store_doc(
loader
=
UnstructuredMarkdownLoader
(
file_path
)
loader
=
UnstructuredMarkdownLoader
(
file_path
)
if
file_ext
in
octet_plain
:
if
file_ext
in
octet_plain
:
loader
=
TextLoader
(
file_path
)
loader
=
TextLoader
(
file_path
)
elif
file
.
content_type
==
"application/x-javascript"
:
loader
=
TextLoader
(
file_path
)
data
=
loader
.
load
()
data
=
loader
.
load
()
result
=
store_data_in_vector_db
(
data
,
collection_name
)
result
=
store_data_in_vector_db
(
data
,
collection_name
)
...
...
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