mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 20:07:49 +01:00
Update main.py
This commit is contained in:
@@ -64,9 +64,7 @@ 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:
|
||||||
collection = CHROMA_CLIENT.create_collection(
|
collection = CHROMA_CLIENT.create_collection(name=collection_name)
|
||||||
name=collection_name, embedding_function=EMBEDDING_FUNC
|
|
||||||
)
|
|
||||||
|
|
||||||
collection.add(
|
collection.add(
|
||||||
documents=texts, metadatas=metadatas, ids=[str(uuid.uuid1()) for _ in texts]
|
documents=texts, metadatas=metadatas, ids=[str(uuid.uuid1()) for _ in texts]
|
||||||
|
|||||||
Reference in New Issue
Block a user