Skip to content

Commit

Permalink
add THUDM/chatglm3-6b chat template test
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmai-dev committed Mar 26, 2024
1 parent 4784c53 commit bc044bd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tests/ChatTemplateTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
)
]

Expand Down

0 comments on commit bc044bd

Please sign in to comment.