Chananchida commited on
Commit
9ee8309
1 Parent(s): c17251d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- Answer = self.model_pipeline(str(message), similar_contexts[0])
140
- start_index = similar_contexts.find(Answer)
 
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,