xaviviro commited on
Commit
59b2d30
1 Parent(s): bcc78d8

Added chatglm3 conversation type for training models like TinyLLama (#1036)

Browse files

* Added chatgml3 conversation type for training models like TinyLLama

* Added chatgml3 conversation type for training models like TinyLLama with lint

* Added chatgml3 conversation type for training models like TinyLLama with lint

src/axolotl/monkeypatch/fastchat_conversation_turns.py CHANGED
@@ -147,6 +147,15 @@ def get_turns( # pylint: disable=too-many-return-statements
147
  else:
148
  yield role + "\n", ""
149
  return
 
 
 
 
 
 
 
 
 
150
  if self.sep_style == SeparatorStyle.CHATINTERN:
151
  # source: https://huggingface.co/internlm/internlm-chat-7b-8k/blob/bd546fa984b4b0b86958f56bf37f94aa75ab8831/modeling_internlm.py#L771
152
  seps = [self.sep, self.sep2]
 
147
  else:
148
  yield role + "\n", ""
149
  return
150
+ if self.sep_style == SeparatorStyle.CHATGLM3:
151
+ if self.system_message:
152
+ yield "", system_prompt
153
+ for role, message in self.messages:
154
+ if message:
155
+ yield role + "\n", " " + message
156
+ else:
157
+ yield role
158
+ return
159
  if self.sep_style == SeparatorStyle.CHATINTERN:
160
  # source: https://huggingface.co/internlm/internlm-chat-7b-8k/blob/bd546fa984b4b0b86958f56bf37f94aa75ab8831/modeling_internlm.py#L771
161
  seps = [self.sep, self.sep2]