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
ad3d69be
"vscode:/vscode.git/clone" did not exist on "0372c51f82b47e16d98244710fa22e4c168f7a79"
Commit
ad3d69be
authored
Jan 07, 2024
by
Timothy J. Baek
Browse files
refac
parent
fb0c2d2a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
5 deletions
+1
-5
backend/apps/rag/main.py
backend/apps/rag/main.py
+1
-5
No files found.
backend/apps/rag/main.py
View file @
ad3d69be
...
...
@@ -72,7 +72,6 @@ def store_data_in_vector_db(data, collection_name) -> bool:
return
True
except
Exception
as
e
:
print
(
e
)
print
(
e
.
__class__
.
__name__
)
if
e
.
__class__
.
__name__
==
"UniqueConstraintError"
:
return
True
...
...
@@ -113,10 +112,7 @@ def store_web(form_data: StoreWebForm):
@
app
.
post
(
"/doc"
)
def
store_doc
(
collection_name
:
str
=
Form
(...),
file
:
UploadFile
=
File
(...)):
# "https://www.gutenberg.org/files/1727/1727-h/1727-h.htm"
file
.
filename
=
f
"
{
uuid
.
uuid4
()
}
-
{
file
.
filename
}
"
print
(
dir
(
file
))
print
(
file
.
content_type
)
file
.
filename
=
f
"
{
collection_name
}
-
{
file
.
filename
}
"
if
file
.
content_type
not
in
[
"application/pdf"
,
"text/plain"
]:
raise
HTTPException
(
...
...
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