Spaces:
Runtime error
Runtime error
always add newline at the end of a question (#53)
Browse files- buster/chatbot.py +4 -0
buster/chatbot.py
CHANGED
@@ -231,6 +231,10 @@ class Chatbot:
|
|
231 |
|
232 |
logger.info(f"User Question:\n{question}")
|
233 |
|
|
|
|
|
|
|
|
|
234 |
matched_documents = self.rank_documents(
|
235 |
documents=self.documents,
|
236 |
query=question,
|
|
|
231 |
|
232 |
logger.info(f"User Question:\n{question}")
|
233 |
|
234 |
+
# We make sure there is always a newline at the end of the question to avoid completing the question.
|
235 |
+
if not question.endswith("\n"):
|
236 |
+
question += "\n"
|
237 |
+
|
238 |
matched_documents = self.rank_documents(
|
239 |
documents=self.documents,
|
240 |
query=question,
|