Update app.py
Browse files
app.py
CHANGED
|
@@ -139,11 +139,12 @@ def create_vector_db(final_items):
|
|
| 139 |
try:
|
| 140 |
db = client.create_collection(
|
| 141 |
name=collection_name,
|
| 142 |
-
metadata={"hnsw:space": "cosine"}
|
|
|
|
| 143 |
)
|
| 144 |
except UniqueConstraintError:
|
| 145 |
print(f"Collection '{collection_name}' already exists.")
|
| 146 |
-
|
| 147 |
|
| 148 |
documents = []
|
| 149 |
|
|
|
|
| 139 |
try:
|
| 140 |
db = client.create_collection(
|
| 141 |
name=collection_name,
|
| 142 |
+
metadata={"hnsw:space": "cosine"},
|
| 143 |
+
embeddding_function = "all-MiniLM-L6-v2"
|
| 144 |
)
|
| 145 |
except UniqueConstraintError:
|
| 146 |
print(f"Collection '{collection_name}' already exists.")
|
| 147 |
+
db = db.get_collection(name=collection_name, embedding_function = "all-MiniLM-L6-v2")
|
| 148 |
|
| 149 |
documents = []
|
| 150 |
|