Update app.py
Browse files
app.py
CHANGED
|
@@ -152,15 +152,13 @@ def create_vector_db(final_items):
|
|
| 152 |
filename="unsloth.BF16.gguf",
|
| 153 |
)
|
| 154 |
|
| 155 |
-
# Placeholder for final results to add to the database
|
| 156 |
documents_to_add = []
|
| 157 |
ids_to_add = []
|
| 158 |
|
| 159 |
for item in final_items:
|
| 160 |
-
|
| 161 |
-
item_id = f"id_{
|
| 162 |
|
| 163 |
-
# Check if the ID already exists in the database
|
| 164 |
existing_documents = db.get(ids=[item_id])
|
| 165 |
|
| 166 |
if not existing_documents: # If the ID does not exist
|
|
|
|
| 152 |
filename="unsloth.BF16.gguf",
|
| 153 |
)
|
| 154 |
|
|
|
|
| 155 |
documents_to_add = []
|
| 156 |
ids_to_add = []
|
| 157 |
|
| 158 |
for item in final_items:
|
| 159 |
+
item2 = str(item)
|
| 160 |
+
item_id = f"id_{item2[:45].replace(' ', '_')}"
|
| 161 |
|
|
|
|
| 162 |
existing_documents = db.get(ids=[item_id])
|
| 163 |
|
| 164 |
if not existing_documents: # If the ID does not exist
|