From 5dfab7d363eddc6bcd0a00546754fbd5ac041113 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Thu, 17 Apr 2025 22:03:11 -0700 Subject: [PATCH] New attempt at solving the exl2 issue --- modules/text_generation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/text_generation.py b/modules/text_generation.py index cbe5b61b..d62441df 100644 --- a/modules/text_generation.py +++ b/modules/text_generation.py @@ -263,6 +263,9 @@ def apply_stopping_strings(reply, all_stop_strings): def get_reply_from_output_ids(output_ids, state=None, starting_from=0): + if torch.cuda.is_available(): + torch.cuda.synchronize() + reply = decode(output_ids[starting_from:], state['skip_special_tokens'] if state else True) # Handle tokenizers that do not add the leading space for the first token