Spaces:
Sleeping
Sleeping
Upload embedding_and_storing.py
Browse files- embedding_and_storing.py +5 -8
embedding_and_storing.py
CHANGED
|
@@ -21,14 +21,11 @@ def embed_and_store(chunks, ids, metadatas, client):
|
|
| 21 |
if collections.get()["ids"]:
|
| 22 |
collections.delete(collections.get()["ids"])
|
| 23 |
|
| 24 |
-
print(collections.get())
|
| 25 |
-
|
| 26 |
collections.add(
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
)
|
| 32 |
-
print("
|
| 33 |
-
print(collections.get(include=['metadatas','documents','embeddings']))
|
| 34 |
return collections
|
|
|
|
| 21 |
if collections.get()["ids"]:
|
| 22 |
collections.delete(collections.get()["ids"])
|
| 23 |
|
|
|
|
|
|
|
| 24 |
collections.add(
|
| 25 |
+
ids=ids,
|
| 26 |
+
embeddings=embeddings,
|
| 27 |
+
metadatas=metadatas,
|
| 28 |
+
documents=chunks
|
| 29 |
)
|
| 30 |
+
print(f"ChromaDB ready — {len(chunks)} chunks indexed")
|
|
|
|
| 31 |
return collections
|