Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -197,8 +197,13 @@ def load_objection_responses(csv_file_path):
|
|
197 |
|
198 |
objection_response_pairs = load_objection_responses(r"C:\Users\bhagy\OneDrive\Desktop\INFOSYS PROJECT\objections_responses.csv")
|
199 |
objections = list(objection_response_pairs.keys())
|
|
|
|
|
|
|
200 |
objection_embeddings = sentence_model.encode(objections)
|
201 |
-
|
|
|
|
|
202 |
|
203 |
def find_closest_objection(query):
|
204 |
query_embedding = sentence_model.encode([query])
|
|
|
197 |
|
198 |
objection_response_pairs = load_objection_responses(r"C:\Users\bhagy\OneDrive\Desktop\INFOSYS PROJECT\objections_responses.csv")
|
199 |
objections = list(objection_response_pairs.keys())
|
200 |
+
# objection_embeddings = sentence_model.encode(objections)
|
201 |
+
# faiss_index.add(np.array(objection_embeddings, dtype="float32"))
|
202 |
+
|
203 |
objection_embeddings = sentence_model.encode(objections)
|
204 |
+
objection_embeddings = objection_embeddings.reshape(-1, 384) # Reshape to 2D array
|
205 |
+
faiss_index.add(objection_embeddings.astype("float32"))
|
206 |
+
|
207 |
|
208 |
def find_closest_objection(query):
|
209 |
query_embedding = sentence_model.encode([query])
|