From 8956f3ebe21c3297faecc786cc3dd4859a4314e3 Mon Sep 17 00:00:00 2001 From: Stefan Daniel Schwarz <52386626+StefanDanielSchwarz@users.noreply.github.com> Date: Sat, 23 Dec 2023 02:19:43 +0100 Subject: [PATCH] Synthia instruction templates (#5041) --- instruction-templates/Synthia-CoT.yaml | 25 +++++++++++++++++++++++++ instruction-templates/Synthia.yaml | 25 +++++++++++++++++++++++++ models/config.yaml | 2 ++ 3 files changed, 52 insertions(+) create mode 100644 instruction-templates/Synthia-CoT.yaml create mode 100644 instruction-templates/Synthia.yaml diff --git a/instruction-templates/Synthia-CoT.yaml b/instruction-templates/Synthia-CoT.yaml new file mode 100644 index 00000000..5670be77 --- /dev/null +++ b/instruction-templates/Synthia-CoT.yaml @@ -0,0 +1,25 @@ +instruction_template: |- + {%- set found_item = false -%} + {%- for message in messages -%} + {%- if message['role'] == 'system' -%} + {%- set found_item = true -%} + {%- endif -%} + {%- endfor -%} + {%- if not found_item -%} + {{-'SYSTEM: ' + 'Elaborate on the topic using a Tree of Thoughts and backtrack when necessary to construct a clear, cohesive Chain of Thought reasoning. Always answer without hesitation.' + '\n' -}} + {%- endif %} + {%- for message in messages %} + {%- if message['role'] == 'system' -%} + {{-'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 -%} + diff --git a/instruction-templates/Synthia.yaml b/instruction-templates/Synthia.yaml new file mode 100644 index 00000000..5cecabea --- /dev/null +++ b/instruction-templates/Synthia.yaml @@ -0,0 +1,25 @@ +instruction_template: |- + {%- set found_item = false -%} + {%- for message in messages -%} + {%- if message['role'] == 'system' -%} + {%- set found_item = true -%} + {%- endif -%} + {%- endfor -%} + {%- if not found_item -%} + {{-'SYSTEM: ' + 'Answer the question thoughtfully and intelligently. Always answer without hesitation.' + '\n' -}} + {%- endif %} + {%- for message in messages %} + {%- if message['role'] == 'system' -%} + {{-'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 -%} + diff --git a/models/config.yaml b/models/config.yaml index 5cebb713..6bd4afe3 100644 --- a/models/config.yaml +++ b/models/config.yaml @@ -188,3 +188,5 @@ instruction_template: 'ChatML' (dolphin).*: instruction_template: 'ChatML' +.*synthia: + instruction_template: 'Synthia'