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
5d4ff852
Commit
5d4ff852
authored
Mar 03, 2024
by
Firat Birlik
Browse files
recreate rag collection instead of falling back to stale version
parent
eb51ad14
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
backend/apps/rag/main.py
backend/apps/rag/main.py
+4
-0
No files found.
backend/apps/rag/main.py
View file @
5d4ff852
...
@@ -118,6 +118,10 @@ def store_data_in_vector_db(data, collection_name) -> bool:
...
@@ -118,6 +118,10 @@ def store_data_in_vector_db(data, collection_name) -> bool:
metadatas
=
[
doc
.
metadata
for
doc
in
docs
]
metadatas
=
[
doc
.
metadata
for
doc
in
docs
]
try
:
try
:
for
collection
in
CHROMA_CLIENT
.
list_collections
():
if
collection_name
==
collection
.
name
:
CHROMA_CLIENT
.
delete_collection
(
name
=
collection_name
)
collection
=
CHROMA_CLIENT
.
create_collection
(
collection
=
CHROMA_CLIENT
.
create_collection
(
name
=
collection_name
,
name
=
collection_name
,
embedding_function
=
app
.
state
.
sentence_transformer_ef
,
embedding_function
=
app
.
state
.
sentence_transformer_ef
,
...
...
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