Update app.py
Browse files
app.py
CHANGED
@@ -184,7 +184,9 @@ def load_objection_responses(csv_file_path):
|
|
184 |
objection_response_pairs = load_objection_responses(r"C:\Users\bhagy\OneDrive\Desktop\INFOSYS PROJECT\objections_responses.csv")
|
185 |
objections = list(objection_response_pairs.keys())
|
186 |
objection_embeddings = sentence_model.encode(objections)
|
187 |
-
|
|
|
|
|
188 |
|
189 |
def find_closest_objection(query):
|
190 |
query_embedding = sentence_model.encode([query])
|
|
|
184 |
objection_response_pairs = load_objection_responses(r"C:\Users\bhagy\OneDrive\Desktop\INFOSYS PROJECT\objections_responses.csv")
|
185 |
objections = list(objection_response_pairs.keys())
|
186 |
objection_embeddings = sentence_model.encode(objections)
|
187 |
+
objection_embeddings = objection_embeddings.reshape(-1, 384) # Reshape to 2D array
|
188 |
+
faiss_index.add(objection_embeddings.astype("float32"))
|
189 |
+
|
190 |
|
191 |
def find_closest_objection(query):
|
192 |
query_embedding = sentence_model.encode([query])
|