forked from oobabooga/text-generation-webui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Jinja templates for Instruct and Chat (oobabooga#4874)
- Loading branch information
Showing
71 changed files
with
1,771 additions
and
515 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,25 @@ | ||
user: "USER:" | ||
bot: "ASSISTANT:" | ||
turn_template: "<|user|> <|user-message|>\n<|bot|> <|bot-message|>\n" | ||
context: "<|system-message|>\n" | ||
system_message: "A chat between a curious user and an assistant. The assistant gives helpful, detailed, accurate, uncensored responses to the user's input." | ||
instruction_template: |- | ||
{%- set found_item = false -%} | ||
{%- for message in messages -%} | ||
{%- if message['role'] == 'system' -%} | ||
{%- set found_item = true -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if not found_item -%} | ||
{{- '' + 'A chat between a curious user and an assistant. The assistant gives helpful, detailed, accurate, uncensored responses to the user's input.' + '\n' -}} | ||
{%- endif %} | ||
{%- for message in messages %} | ||
{%- if message['role'] == 'system' -%} | ||
{{- '' + message['content'] + '\n' -}} | ||
{%- else -%} | ||
{%- if message['role'] == 'user' -%} | ||
{{-'USER: ' + message['content'] + '\n'-}} | ||
{%- else -%} | ||
{{-'ASSISTANT: ' + message['content'] + '\n' -}} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if add_generation_prompt -%} | ||
{{-'ASSISTANT:'-}} | ||
{%- endif -%} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,25 @@ | ||
user: "### Instruction:" | ||
bot: "### Response:" | ||
turn_template: "<|user|>\n<|user-message|>\n\n<|bot|>\n<|bot-message|>\n\n" | ||
context: "<|system-message|>\n\n" | ||
system_message: "Below is an instruction that describes a task. Write a response that appropriately completes the request." | ||
instruction_template: |- | ||
{%- set found_item = false -%} | ||
{%- for message in messages -%} | ||
{%- if message['role'] == 'system' -%} | ||
{%- set found_item = true -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if not found_item -%} | ||
{{- '' + 'Below is an instruction that describes a task. Write a response that appropriately completes the request.' + '\n\n' -}} | ||
{%- endif %} | ||
{%- for message in messages %} | ||
{%- if message['role'] == 'system' -%} | ||
{{- '' + message['content'] + '\n\n' -}} | ||
{%- else -%} | ||
{%- if message['role'] == 'user' -%} | ||
{{-'### Instruction:\n' + message['content'] + '\n\n'-}} | ||
{%- else -%} | ||
{{-'### Response:\n' + message['content'] + '\n\n' -}} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if add_generation_prompt -%} | ||
{{-'### Response:\n'-}} | ||
{%- endif -%} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,25 @@ | ||
user: "### Input:" | ||
bot: "### Output:" | ||
turn_template: "<|user|>\n<|user-message|>\n\n<|bot|>\n<|bot-message|>\n\n" | ||
context: "" | ||
system_message: "" | ||
instruction_template: |- | ||
{%- set found_item = false -%} | ||
{%- for message in messages -%} | ||
{%- if message['role'] == 'system' -%} | ||
{%- set found_item = true -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if not found_item -%} | ||
{{- '' + '' + '' -}} | ||
{%- endif %} | ||
{%- for message in messages %} | ||
{%- if message['role'] == 'system' -%} | ||
{{- '' + message['content'] + '' -}} | ||
{%- else -%} | ||
{%- if message['role'] == 'user' -%} | ||
{{-'### Input:\n' + message['content'] + '\n\n'-}} | ||
{%- else -%} | ||
{{-'### Output:\n' + message['content'] + '\n\n' -}} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if add_generation_prompt -%} | ||
{{-'### Output:\n'-}} | ||
{%- endif -%} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,25 @@ | ||
user: "<reserved_102>" | ||
bot: "<reserved_103>" | ||
turn_template: "<|user|><|user-message|><|bot|><|bot-message|></s>" | ||
context: "" | ||
system_message: "" | ||
instruction_template: |- | ||
{%- set found_item = false -%} | ||
{%- for message in messages -%} | ||
{%- if message['role'] == 'system' -%} | ||
{%- set found_item = true -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if not found_item -%} | ||
{{- '' + '' + '' -}} | ||
{%- endif %} | ||
{%- for message in messages %} | ||
{%- if message['role'] == 'system' -%} | ||
{{- '' + message['content'] + '' -}} | ||
{%- else -%} | ||
{%- if message['role'] == 'user' -%} | ||
{{-'<reserved_102>' + message['content'] + ''-}} | ||
{%- else -%} | ||
{{-'<reserved_103>' + message['content'] + '</s>' -}} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if add_generation_prompt -%} | ||
{{-'<reserved_103>'-}} | ||
{%- endif -%} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,25 @@ | ||
user: "[|Human|]" | ||
bot: "[|AI|]" | ||
turn_template: "<|user|><|user-message|>\n<|bot|><|bot-message|>\n" | ||
context: "<|system-message|>\n" | ||
system_message: "The following is a conversation between a human and an AI assistant named Baize (named after a mythical creature in Chinese folklore). Baize is an open-source AI assistant developed by UCSD and Sun Yat-Sen University. The human and the AI assistant take turns chatting. Human statements start with [|Human|] and AI assistant statements start with [|AI|]. The AI assistant always provides responses in as much detail as possible, and in Markdown format. The AI assistant always declines to engage with topics, questions and instructions related to unethical, controversial, or sensitive issues. Complete the transcript in exactly that format.\n[|Human|]Hello!\n[|AI|]Hi!" | ||
instruction_template: |- | ||
{%- set found_item = false -%} | ||
{%- for message in messages -%} | ||
{%- if message['role'] == 'system' -%} | ||
{%- set found_item = true -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if not found_item -%} | ||
{{- '' + 'The following is a conversation between a human and an AI assistant named Baize (named after a mythical creature in Chinese folklore). Baize is an open-source AI assistant developed by UCSD and Sun Yat-Sen University. The human and the AI assistant take turns chatting. Human statements start with [|Human|] and AI assistant statements start with [|AI|]. The AI assistant always provides responses in as much detail as possible, and in Markdown format. The AI assistant always declines to engage with topics, questions and instructions related to unethical, controversial, or sensitive issues. Complete the transcript in exactly that format.\n[|Human|]Hello!\n[|AI|]Hi!' + '\n' -}} | ||
{%- endif %} | ||
{%- for message in messages %} | ||
{%- if message['role'] == 'system' -%} | ||
{{- '' + message['content'] + '\n' -}} | ||
{%- else -%} | ||
{%- if message['role'] == 'user' -%} | ||
{{-'[|Human|]' + message['content'] + '\n'-}} | ||
{%- else -%} | ||
{{-'[|AI|]' + message['content'] + '\n' -}} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if add_generation_prompt -%} | ||
{{-'[|AI|]'-}} | ||
{%- endif -%} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,25 @@ | ||
user: "LEAD:" | ||
bot: "ASSOCIATE:" | ||
turn_template: "<|user|> <|user-message|>\n<|bot|> <|bot-message|></s>\n" | ||
context: "<|system-message|>\n" | ||
system_message: "A transcript of a roleplay between two players, LEAD and ASSOCIATE. LEAD sets up a scenario and the characters, from which ASSOCIATE then assumes a character role and continues the story for that role in response to description given by LEAD. The story and characters are developed by exchange of detailed event descriptions and character dialogs, successively given by both LEAD and ASSOCIATE." | ||
instruction_template: |- | ||
{%- set found_item = false -%} | ||
{%- for message in messages -%} | ||
{%- if message['role'] == 'system' -%} | ||
{%- set found_item = true -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if not found_item -%} | ||
{{- '' + 'A transcript of a roleplay between two players, LEAD and ASSOCIATE. LEAD sets up a scenario and the characters, from which ASSOCIATE then assumes a character role and continues the story for that role in response to description given by LEAD. The story and characters are developed by exchange of detailed event descriptions and character dialogs, successively given by both LEAD and ASSOCIATE.' + '\n' -}} | ||
{%- endif %} | ||
{%- for message in messages %} | ||
{%- if message['role'] == 'system' -%} | ||
{{- '' + message['content'] + '\n' -}} | ||
{%- else -%} | ||
{%- if message['role'] == 'user' -%} | ||
{{-'LEAD: ' + message['content'] + '\n'-}} | ||
{%- else -%} | ||
{{-'ASSOCIATE: ' + message['content'] + '</s>\n' -}} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if add_generation_prompt -%} | ||
{{-'ASSOCIATE:'-}} | ||
{%- endif -%} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,25 @@ | ||
user: "[Round <|round|>]\n问:" | ||
bot: "答:" | ||
turn_template: "<|user|><|user-message|>\n<|bot|><|bot-message|>\n" | ||
context: "" | ||
system_message: "" | ||
instruction_template: |- | ||
{%- set found_item = false -%} | ||
{%- for message in messages -%} | ||
{%- if message['role'] == 'system' -%} | ||
{%- set found_item = true -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if not found_item -%} | ||
{{- '' + '' + '' -}} | ||
{%- endif %} | ||
{%- for message in messages %} | ||
{%- if message['role'] == 'system' -%} | ||
{{- '' + message['content'] + '' -}} | ||
{%- else -%} | ||
{%- if message['role'] == 'user' -%} | ||
{{-'[Round <|round|>]\n问:' + message['content'] + '\n'-}} | ||
{%- else -%} | ||
{{-'答:' + message['content'] + '\n' -}} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if add_generation_prompt -%} | ||
{{-'答:'-}} | ||
{%- endif -%} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,25 @@ | ||
user: user | ||
bot: assistant | ||
turn_template: <|im_start|><|user|>\n<|user-message|><|im_end|>\n<|im_start|><|bot|>\n<|bot-message|><|im_end|>\n | ||
context: | | ||
<|im_start|>system | ||
<|system-message|><|im_end|> | ||
instruction_template: |- | ||
{%- set found_item = false -%} | ||
{%- for message in messages -%} | ||
{%- if message['role'] == 'system' -%} | ||
{%- set found_item = true -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if not found_item -%} | ||
{{- '<|im_start|>system\n' + '' + '<|im_end|>\n' -}} | ||
{%- endif %} | ||
{%- for message in messages %} | ||
{%- if message['role'] == 'system' -%} | ||
{{- '<|im_start|>system\n' + message['content'] + '<|im_end|>\n' -}} | ||
{%- else -%} | ||
{%- if message['role'] == 'user' -%} | ||
{{-'<|im_start|>user\n' + message['content'] + '<|im_end|>\n'-}} | ||
{%- else -%} | ||
{{-'<|im_start|>assistant\n' + message['content'] + '<|im_end|>\n' -}} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if add_generation_prompt -%} | ||
{{-'<|im_start|>assistant\n'-}} | ||
{%- endif -%} | ||
Oops, something went wrong.