Spaces:
Sleeping
Sleeping
Chananchida
commited on
Commit
•
9ee8309
1
Parent(s):
c17251d
Update app.py
Browse files
app.py
CHANGED
@@ -136,8 +136,9 @@ class Chatbot:
|
|
136 |
question_vector = self.get_embeddings(message)
|
137 |
question_vector = self.prepare_sentences_vector([question_vector])
|
138 |
similar_questions, similar_contexts, distances, indices = self.faiss_search(question_vector)
|
139 |
-
|
140 |
-
|
|
|
141 |
end_index = start_index + len(Answer)
|
142 |
output = {
|
143 |
"user_question": message,
|
|
|
136 |
question_vector = self.get_embeddings(message)
|
137 |
question_vector = self.prepare_sentences_vector([question_vector])
|
138 |
similar_questions, similar_contexts, distances, indices = self.faiss_search(question_vector)
|
139 |
+
context = similar_contexts[0]
|
140 |
+
Answer = self.model_pipeline(str(message), context)
|
141 |
+
start_index = context.find(Answer)
|
142 |
end_index = start_index + len(Answer)
|
143 |
output = {
|
144 |
"user_question": message,
|