diff --git a/modules/text_generation.py b/modules/text_generation.py index 8c2fe0b2..37189f18 100644 --- a/modules/text_generation.py +++ b/modules/text_generation.py @@ -96,7 +96,7 @@ def _generate_reply(question, state, stopping_strings=None, is_chat=False, escap last_update = cur_time yield reply - if stop_found: + if stop_found or (state['max_tokens_second'] > 0 and shared.stop_everything): break if not is_chat: