Skip to content

Commit

Permalink
make fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocketknight1 committed Jan 7, 2025
1 parent d30f032 commit c465798
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_tokenization_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ def test_chat_template(self):
with tempfile.TemporaryDirectory() as tmp_dir_name:
save_files = tokenizer.save_pretrained(tmp_dir_name)
# Check we aren't saving a chat_template.jinja file
self.assertFalse(any([file.endswith("chat_template.jinja") for file in save_files]))
self.assertFalse(any(file.endswith("chat_template.jinja") for file in save_files))
new_tokenizer = tokenizer.from_pretrained(tmp_dir_name)

self.assertEqual(new_tokenizer.chat_template, dummy_template) # Test template has persisted
Expand All @@ -1121,7 +1121,7 @@ def test_chat_template(self):
with tempfile.TemporaryDirectory() as tmp_dir_name:
save_files = tokenizer.save_pretrained(tmp_dir_name, save_raw_chat_template=True)
# Check we are saving a chat_template.jinja file
self.assertTrue(any([file.endswith("chat_template.jinja") for file in save_files]))
self.assertTrue(any(file.endswith("chat_template.jinja") for file in save_files))
chat_template_file = Path(tmp_dir_name) / "chat_template.jinja"
self.assertTrue(chat_template_file.is_file())
self.assertEqual(chat_template_file.read_text(), dummy_template)
Expand Down

0 comments on commit c465798

Please sign in to comment.