File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -770,14 +770,11 @@ def test_chat_template_save_loading(self):
770770 # the reloaded tokenizer should get the chat template as well
771771 self .assertEqual (reloaded_processor .chat_template , reloaded_processor .tokenizer .chat_template )
772772
773- with tempfile .TemporaryDirectory () as tmpdirname :
774- processor .chat_template = {"default" : "a" , "secondary" : "b" }
775- processor .save_pretrained (tmpdirname , save_jinja_files = False )
776- self .assertFalse (Path (tmpdirname , "chat_template.jinja" ).is_file ())
777- self .assertTrue (Path (tmpdirname , "chat_template.json" ).is_file ())
778- self .assertFalse (Path (tmpdirname , "additional_chat_templates" ).is_dir ())
779- reloaded_processor = self .processor_class .from_pretrained (tmpdirname )
780- self .assertEqual (processor .chat_template , reloaded_processor .chat_template )
773+ with self .assertRaises (ValueError ):
774+ # Saving multiple templates in the legacy format is not permitted
775+ with tempfile .TemporaryDirectory () as tmpdirname :
776+ processor .chat_template = {"default" : "a" , "secondary" : "b" }
777+ processor .save_pretrained (tmpdirname , save_jinja_files = False )
781778
782779 def test_image_chat_template_single (self ):
783780 processor = self .get_processor ()
You can’t perform that action at this time.
0 commit comments