AzizTh commited on
Commit
a9f61e8
·
verified ·
1 Parent(s): 8f70b69

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -28,7 +28,7 @@ def search(query):
28
  query_vector = model.encode([query])[0].astype('float32')
29
 
30
  # Search the FAISS index
31
- distances, indices = index.search(np.array([query_vector]), k=5) # Search for top 5 closest vectors
32
 
33
  # Return corresponding content for the top results using the indices
34
  results = [f"Content: {content_column[i]}\nDistance: {d:.4f}" for i, d in zip(indices[0], distances[0])]
 
28
  query_vector = model.encode([query])[0].astype('float32')
29
 
30
  # Search the FAISS index
31
+ distances, indices = index.search(np.array([query_vector]), k=1) # Search for top 5 closest vectors
32
 
33
  # Return corresponding content for the top results using the indices
34
  results = [f"Content: {content_column[i]}\nDistance: {d:.4f}" for i, d in zip(indices[0], distances[0])]