From 80f6abb07e44cb70d65a0d43fe9676a02880eb2c Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Tue, 5 Aug 2025 16:01:19 -0700 Subject: [PATCH] Begin fixing 'Continue' with GPT-OSS --- modules/chat.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/chat.py b/modules/chat.py index 1f4e2af0..b23340aa 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -165,6 +165,7 @@ class LinearTemplateHandler(TemplateHandler): suffix = self.get_generation_prefix_suffix(renderer, impersonate)[1] if len(suffix) > 0: return prompt[:-len(suffix)] + return prompt @@ -199,7 +200,10 @@ class ChannelTemplateHandler(TemplateHandler): ] def modify_for_continue(self, prompt, renderer, impersonate=False): - # Channels don't need suffix stripping for the continue logic to work. + suffix = '<|return|>' + if prompt.endswith(suffix): + return prompt[:-len(suffix)] + return prompt