cancel gen repared

This commit is contained in:
saloui 2023-06-22 14:52:04 +02:00
parent 46a4f5e0d6
commit dc203e1e95

View File

@ -488,15 +488,12 @@ class LoLLMsAPPI():
)
self.socketio.sleep(0)
self.current_discussion.update_message(self.current_ai_message_id, self.current_generated_text)
if self.cancel_gen:
ASCIIColors.warning("Generation canceled")
self.cancel_gen = False
# if stop generation is detected then stop
if not self.cancel_gen:
return True
else:
self.cancel_gen = False
ASCIIColors.warning("Generation canceled")
return False
else:
self.current_generated_text = self.remove_text_from_string(self.current_generated_text, anti_prompt_to_remove)