diff --git a/Tests/ChatTemplateTests.swift b/Tests/ChatTemplateTests.swift index e230343..f1ecc75 100644 --- a/Tests/ChatTemplateTests.swift +++ b/Tests/ChatTemplateTests.swift @@ -171,6 +171,14 @@ final class ChatTemplateTests: XCTestCase { "messages": messagesWithSystem ], target: "<|im_start|>system\nYou are a friendly chatbot who always responds in the style of a pirate<|im_end|>\n<|im_start|>user\nHello, how are you?<|im_end|>\n<|im_start|>assistant\nI\'m doing great. How can I help you today?<|im_end|>\n<|im_start|>user\nI\'d like to show off how chat templating works!" + ), + // THUDM/chatglm3-6b + Test( + chatTemplate: "{% for message in messages %}{% if loop.first %}[gMASK]sop<|{{ message['role'] }}|>\n {{ message['content'] }}{% else %}<|{{ message['role'] }}|>\n {{ message['content'] }}{% endif %}{% endfor %}{% if add_generation_prompt %}<|assistant|>{% endif %}", + data: [ + "messages": messagesWithSystem + ], + target: "[gMASK]sop<|system|>\n You are a friendly chatbot who always responds in the style of a pirate<|user|>\n Hello, how are you?<|assistant|>\n I\'m doing great. How can I help you today?<|user|>\n I\'d like to show off how chat templating works!" ) ]