Spaces:
Running
Running
Husnain
commited on
Commit
•
18ccd47
1
Parent(s):
c18033f
💎 [Feature] New model supported: command-r-plus (CohereForai/c4ai-com…
Browse files
messagers/message_composer.py
CHANGED
@@ -52,7 +52,7 @@ class MessageComposer:
|
|
52 |
# - https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1#instruction-format
|
53 |
# - https://huggingface.co/NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO#prompt-format
|
54 |
# - https://huggingface.co/openchat/openchat-3.5-0106
|
55 |
-
# - https://huggingface.co/google/gemma-7b-it#chat-template
|
56 |
|
57 |
# Mistral and Mixtral:
|
58 |
# <s> [INST] Instruction [/INST] Model answer </s> [INST] Follow-up instruction [/INST]
|
@@ -125,8 +125,8 @@ class MessageComposer:
|
|
125 |
)
|
126 |
self.merged_str_list.append(f"GPT4 Correct Assistant:\n")
|
127 |
self.merged_str = "\n".join(self.merged_str_list)
|
128 |
-
# https://huggingface.co/google/gemma-7b-it#chat-template
|
129 |
-
elif self.model in ["gemma-7b"]:
|
130 |
self.messages = self.concat_messages_by_role(messages)
|
131 |
self.merged_str_list = []
|
132 |
self.end_of_turn = "<end_of_turn>"
|
@@ -167,7 +167,7 @@ class MessageComposer:
|
|
167 |
if __name__ == "__main__":
|
168 |
# model = "mixtral-8x7b"
|
169 |
# model = "nous-mixtral-8x7b"
|
170 |
-
# model = "gemma-7b"
|
171 |
# model = "openchat-3.5"
|
172 |
model = "command-r-plus"
|
173 |
composer = MessageComposer(model)
|
|
|
52 |
# - https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1#instruction-format
|
53 |
# - https://huggingface.co/NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO#prompt-format
|
54 |
# - https://huggingface.co/openchat/openchat-3.5-0106
|
55 |
+
# - https://huggingface.co/google/gemma-1.1-7b-it#chat-template
|
56 |
|
57 |
# Mistral and Mixtral:
|
58 |
# <s> [INST] Instruction [/INST] Model answer </s> [INST] Follow-up instruction [/INST]
|
|
|
125 |
)
|
126 |
self.merged_str_list.append(f"GPT4 Correct Assistant:\n")
|
127 |
self.merged_str = "\n".join(self.merged_str_list)
|
128 |
+
# https://huggingface.co/google/gemma-1.1-7b-it#chat-template
|
129 |
+
elif self.model in ["gemma-1.1-7b"]:
|
130 |
self.messages = self.concat_messages_by_role(messages)
|
131 |
self.merged_str_list = []
|
132 |
self.end_of_turn = "<end_of_turn>"
|
|
|
167 |
if __name__ == "__main__":
|
168 |
# model = "mixtral-8x7b"
|
169 |
# model = "nous-mixtral-8x7b"
|
170 |
+
# model = "gemma-1.1-7b"
|
171 |
# model = "openchat-3.5"
|
172 |
model = "command-r-plus"
|
173 |
composer = MessageComposer(model)
|