mirror of
https://github.com/open-webui/open-webui.git
synced 2025-08-28 14:50:46 +02:00
recreate rag collection instead of falling back to stale version
This commit is contained in:
@@ -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,
|
||||||
|
Reference in New Issue
Block a user