Skip to content

Commit 845b7ba

Browse files
committed
Fix Bloom test
1 parent 7f5987d commit 845b7ba

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

tests/models/bloom/test_tokenization_bloom.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ def test_encodings_from_xnli_dataset(self):
135135
@require_jinja
136136
def test_tokenization_for_chat(self):
137137
tokenizer = self.get_rust_tokenizer()
138+
tokenizer.chat_template = "{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}"
138139
test_chats = [
139140
[{"role": "system", "content": "You are a helpful chatbot."}, {"role": "user", "content": "Hello!"}],
140141
[

tests/models/gpt2/test_tokenization_gpt2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def test_special_tokens_mask_input_pairs_and_bos_token(self):
280280
@require_jinja
281281
def test_tokenization_for_chat(self):
282282
tokenizer = GPT2Tokenizer.from_pretrained(self.tmpdirname)
283-
tokenizer.chat_template = '{% for message in messages %}{{ message.content }}{{ eos_token }}{% endfor %}'
283+
tokenizer.chat_template = "{% for message in messages %}{{ message.content }}{{ eos_token }}{% endfor %}"
284284
test_chats = [
285285
[{"role": "system", "content": "You are a helpful chatbot."}, {"role": "user", "content": "Hello!"}],
286286
[

0 commit comments

Comments
 (0)