Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -576,11 +576,14 @@ def handle_query(user_question, chatbot, audio=None):
|
|
576 |
while not future.done():
|
577 |
if stop_event.is_set():
|
578 |
future.cancel()
|
579 |
-
|
|
|
|
|
580 |
time.sleep(1) # Wait for 1 second before checking again
|
581 |
|
582 |
if future.cancelled():
|
583 |
-
|
|
|
584 |
else:
|
585 |
try:
|
586 |
user_question1, response_text1 = future.result() # Get the result of the completed future
|
@@ -598,10 +601,7 @@ def stop_processing(chatbot):
|
|
598 |
if future and not future.done():
|
599 |
stop_event.set() # Signal the process to stop
|
600 |
future.cancel() # Attempt to cancel the future
|
601 |
-
|
602 |
-
return gr.update(value=chatbot)
|
603 |
-
#return "No ongoing processing to stop."
|
604 |
-
chatbot.append(("Sorry, there is some issue with the query. Please try after some time.", ""))
|
605 |
return gr.update(value=chatbot)
|
606 |
|
607 |
def answer_question_test(user_question, chatbot, audio=None):
|
|
|
576 |
while not future.done():
|
577 |
if stop_event.is_set():
|
578 |
future.cancel()
|
579 |
+
chatbot.append((user_question, "Sorry, we encountered an error while processing your request. Please try after some time."))
|
580 |
+
return gr.update(value=chatbot)
|
581 |
+
|
582 |
time.sleep(1) # Wait for 1 second before checking again
|
583 |
|
584 |
if future.cancelled():
|
585 |
+
chatbot.append((user_question, "Sorry, we encountered an error while processing your request. Please try after some time."))
|
586 |
+
return gr.update(value=chatbot)
|
587 |
else:
|
588 |
try:
|
589 |
user_question1, response_text1 = future.result() # Get the result of the completed future
|
|
|
601 |
if future and not future.done():
|
602 |
stop_event.set() # Signal the process to stop
|
603 |
future.cancel() # Attempt to cancel the future
|
604 |
+
chatbot.append((user_question, "Sorry, we encountered an error while processing your request. Please try after some time."))
|
|
|
|
|
|
|
605 |
return gr.update(value=chatbot)
|
606 |
|
607 |
def answer_question_test(user_question, chatbot, audio=None):
|