Add .rstrip(' ') to openai api

This commit is contained in:
oobabooga 2023-05-12 14:40:48 -03:00
parent 3f1bfba718
commit c746a5bd00

View File

@ -70,7 +70,7 @@ def deduce_template():
.replace('<|user|>', instruct.get('user', ''))\ .replace('<|user|>', instruct.get('user', ''))\
.replace('<|bot|>', instruct.get('bot', ''))\ .replace('<|bot|>', instruct.get('bot', ''))\
.replace('<|user-message|>', '{instruction}\n{input}') .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: except:
return default_template return default_template