mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-21 23:57:58 +01:00
Prevent double <BOS_TOKEN> with Command R+
This commit is contained in:
parent
1bdceea2d4
commit
dd6e4ac55f
@ -125,7 +125,7 @@ def generate_chat_prompt(user_input, state, **kwargs):
|
||||
messages.append({"role": "user", "content": user_input})
|
||||
|
||||
def remove_extra_bos(prompt):
|
||||
for bos_token in ['<s>', '<|startoftext|>']:
|
||||
for bos_token in ['<s>', '<|startoftext|>', '<BOS_TOKEN>', '<|endoftext|>']:
|
||||
while prompt.startswith(bos_token):
|
||||
prompt = prompt[len(bos_token):]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user