diff --git a/modules/chat.py b/modules/chat.py index 5fb5523c..4e0bde1c 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -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 ['', '<|startoftext|>']: + for bos_token in ['', '<|startoftext|>', '', '<|endoftext|>']: while prompt.startswith(bos_token): prompt = prompt[len(bos_token):]