Added chatglm3 conversation type for training models like TinyLLama (#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
This commit is contained in:
@@ -147,6 +147,15 @@ def get_turns( # pylint: disable=too-many-return-statements
|
|||||||
else:
|
else:
|
||||||
yield role + "\n", ""
|
yield role + "\n", ""
|
||||||
return
|
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:
|
if self.sep_style == SeparatorStyle.CHATINTERN:
|
||||||
# source: https://huggingface.co/internlm/internlm-chat-7b-8k/blob/bd546fa984b4b0b86958f56bf37f94aa75ab8831/modeling_internlm.py#L771
|
# source: https://huggingface.co/internlm/internlm-chat-7b-8k/blob/bd546fa984b4b0b86958f56bf37f94aa75ab8831/modeling_internlm.py#L771
|
||||||
seps = [self.sep, self.sep2]
|
seps = [self.sep, self.sep2]
|
||||||
|
|||||||
Reference in New Issue
Block a user