From 5e146b2f9249c706fc004e69502ba1bd1b7af3f4 Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 2 Jul 2024 17:05:34 +0100 Subject: [PATCH] Fix GPT2 test --- tests/models/gpt2/test_tokenization_gpt2.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/models/gpt2/test_tokenization_gpt2.py b/tests/models/gpt2/test_tokenization_gpt2.py index 9d13822ac64b67..975ede8faf377d 100644 --- a/tests/models/gpt2/test_tokenization_gpt2.py +++ b/tests/models/gpt2/test_tokenization_gpt2.py @@ -280,6 +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 %}' test_chats = [ [{"role": "system", "content": "You are a helpful chatbot."}, {"role": "user", "content": "Hello!"}], [