Skip to content

Commit

Permalink
Added chatglm3 conversation type for training models like TinyLLama (#…
Browse files Browse the repository at this point in the history
…1036)

* 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
  • Loading branch information
xaviviro committed Jan 4, 2024
1 parent bcc78d8 commit 59b2d30
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/axolotl/monkeypatch/fastchat_conversation_turns.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ def get_turns( # pylint: disable=too-many-return-statements
else:
yield role + "\n", ""
return
if self.sep_style == SeparatorStyle.CHATGLM3:
if self.system_message:
yield "", system_prompt
for role, message in self.messages:
if message:
yield role + "\n", " " + message
else:
yield role
return
if self.sep_style == SeparatorStyle.CHATINTERN:
# source: https://huggingface.co/internlm/internlm-chat-7b-8k/blob/bd546fa984b4b0b86958f56bf37f94aa75ab8831/modeling_internlm.py#L771
seps = [self.sep, self.sep2]
Expand Down

0 comments on commit 59b2d30

Please sign in to comment.