Zaious commited on
Commit
150d61f
·
verified ·
1 Parent(s): 773316e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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 = df.iloc[indices[0]]
57
- return matching_products, distances[0]
 
 
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: