Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -52,9 +52,11 @@ def find_similar_products(query_embedding, top_k=8):
|
|
| 52 |
# Perform FAISS search
|
| 53 |
distances, indices = faiss_index.search(query_embedding, top_k)
|
| 54 |
|
| 55 |
-
# Retrieve matching products
|
| 56 |
-
matching_products =
|
| 57 |
-
|
|
|
|
|
|
|
| 58 |
|
| 59 |
# Rest of the code remains the same...
|
| 60 |
def analyze_query_and_find_products(query: str) -> str:
|
|
|
|
| 52 |
# Perform FAISS search
|
| 53 |
distances, indices = faiss_index.search(query_embedding, top_k)
|
| 54 |
|
| 55 |
+
# Retrieve metadata for matching products
|
| 56 |
+
matching_products = [product_metadata_list[idx] for idx in indices[0]]
|
| 57 |
+
matching_distances = distances[0]
|
| 58 |
+
|
| 59 |
+
return matching_products, matching_distances
|
| 60 |
|
| 61 |
# Rest of the code remains the same...
|
| 62 |
def analyze_query_and_find_products(query: str) -> str:
|