diff --git a/extensions/openai/script.py b/extensions/openai/script.py index 5c62ceb2..95fe181c 100644 --- a/extensions/openai/script.py +++ b/extensions/openai/script.py @@ -70,7 +70,7 @@ def deduce_template(): .replace('<|user|>', instruct.get('user', ''))\ .replace('<|bot|>', instruct.get('bot', ''))\ .replace('<|user-message|>', '{instruction}\n{input}') - return instruct.get('context', '') + template[:template.find('<|bot-message|>')] + return instruct.get('context', '') + template[:template.find('<|bot-message|>')].rstrip(' ') except: return default_template