mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 08:07:56 +01:00
Revert #1579, apply the proper fix
Apparently models dislike trailing spaces.
This commit is contained in:
parent
a941c19337
commit
1d8b8222e9
@ -1,4 +1,4 @@
|
|||||||
name: "### Assistant:"
|
name: "### Assistant:"
|
||||||
your_name: "### Human:"
|
your_name: "### Human:"
|
||||||
context: "A chat between a human and an assistant.\n\n"
|
context: "A chat between a human and an assistant.\n\n"
|
||||||
turn_template: "<|user|> <|user-message|>\n<|bot|><|bot-message|>\n"
|
turn_template: "<|user|> <|user-message|>\n<|bot|> <|bot-message|>\n"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
name: "ASSISTANT:"
|
name: "ASSISTANT:"
|
||||||
your_name: "USER:"
|
your_name: "USER:"
|
||||||
context: "A chat between a user and an assistant.\n\n"
|
context: "A chat between a user and an assistant.\n\n"
|
||||||
turn_template: "<|user|> <|user-message|>\n<|bot|><|bot-message|></s>\n"
|
turn_template: "<|user|> <|user-message|>\n<|bot|> <|bot-message|></s>\n"
|
||||||
|
@ -56,8 +56,8 @@ def generate_chat_prompt(user_input, state, **kwargs):
|
|||||||
|
|
||||||
user_turn = replace_all(template.split('<|bot|>')[0], replacements)
|
user_turn = replace_all(template.split('<|bot|>')[0], replacements)
|
||||||
bot_turn = replace_all('<|bot|>' + template.split('<|bot|>')[1], replacements)
|
bot_turn = replace_all('<|bot|>' + template.split('<|bot|>')[1], replacements)
|
||||||
user_turn_stripped = replace_all(user_turn.split('<|user-message|>')[0], replacements)
|
user_turn_stripped = replace_all(user_turn.split('<|user-message|>')[0], replacements).rstrip(' ')
|
||||||
bot_turn_stripped = replace_all(bot_turn.split('<|bot-message|>')[0], replacements)
|
bot_turn_stripped = replace_all(bot_turn.split('<|bot-message|>')[0], replacements).rstrip(' ')
|
||||||
|
|
||||||
# Building the prompt
|
# Building the prompt
|
||||||
i = len(shared.history['internal']) - 1
|
i = len(shared.history['internal']) - 1
|
||||||
|
Loading…
Reference in New Issue
Block a user