Skip to content

Commit

Permalink
Fix Bloom test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocketknight1 committed Jul 5, 2024
1 parent b3aec9c commit f0f2f2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/models/bloom/test_tokenization_bloom.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def test_encodings_from_xnli_dataset(self):
@require_jinja
def test_tokenization_for_chat(self):
tokenizer = self.get_rust_tokenizer()
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 %}"
test_chats = [
[{"role": "system", "content": "You are a helpful chatbot."}, {"role": "user", "content": "Hello!"}],
[
Expand Down
2 changes: 1 addition & 1 deletion tests/models/gpt2/test_tokenization_gpt2.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def test_special_tokens_mask_input_pairs_and_bos_token(self):
@require_jinja
def test_tokenization_for_chat(self):
tokenizer = GPT2Tokenizer.from_pretrained(self.tmpdirname)
tokenizer.chat_template = '{% for message in messages %}{{ message.content }}{{ eos_token }}{% endfor %}'
tokenizer.chat_template = "{% for message in messages %}{{ message.content }}{{ eos_token }}{% endfor %}"
test_chats = [
[{"role": "system", "content": "You are a helpful chatbot."}, {"role": "user", "content": "Hello!"}],
[
Expand Down

0 comments on commit f0f2f2e

Please sign in to comment.