updated code to shut down the model if it goes rogue

This commit is contained in:
ParisNeo 2023-04-24 00:50:17 +02:00
parent 42d63d99a8
commit 7b10bf9ef5

2
app.py
View File

@ -279,8 +279,8 @@ class Gpt4AllWebUI(GPT4AllAPI):
time.sleep(0.1)
if self.cancel_gen:
self.generating = False
app.config['executor'].shutdownNow(False)
print("## Done ##")
app.config['executor'].shutdown(True, timeout=5)
self.current_discussion.update_message(response_id, self.bot_says)
self.full_message_list.append(self.bot_says)
bot_says = markdown.markdown(self.bot_says)