Ahmadkhan12 commited on
Commit
afbfc0e
·
verified ·
1 Parent(s): 61651bd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -91,4 +91,15 @@ def main():
91
  query_embedding = model.encode([query], convert_to_numpy=True)
92
 
93
  # Perform similarity search using FAISS
94
- st.write("Searching.
 
 
 
 
 
 
 
 
 
 
 
 
91
  query_embedding = model.encode([query], convert_to_numpy=True)
92
 
93
  # Perform similarity search using FAISS
94
+ st.write("Searching...")
95
+ start_time = time.time()
96
+ D, I = index.search(query_embedding, k=5)
97
+ end_time = time.time()
98
+
99
+ # Display the results
100
+ st.write(f"Query processed in {end_time - start_time:.2f} seconds.")
101
+ for i in range(len(I[0])):
102
+ st.write(f"Match {i + 1}: {text_chunks[I[0][i]]} (Distance: {D[0][i]:.4f})")
103
+
104
+ if __name__ == "__main__":
105
+ main()