diff --git a/tests/models/janus/test_processor_janus.py b/tests/models/janus/test_processor_janus.py index 8b664bb7432..bd0d2cbe018 100644 --- a/tests/models/janus/test_processor_janus.py +++ b/tests/models/janus/test_processor_janus.py @@ -20,7 +20,6 @@ import unittest import numpy as np from transformers import AutoProcessor, AutoTokenizer, JanusProcessor -from transformers.models.janus.convert_janus_weights_to_hf import CHAT_TEMPLATE from transformers.utils import is_vision_available from ...test_processing_common import ProcessorTesterMixin @@ -45,6 +44,9 @@ class JanusProcessorTest(ProcessorTesterMixin, unittest.TestCase): "deepseek-community/Janus-Pro-1B", extra_special_tokens=special_image_tokens, ) + # Set the processor to use the default system prompt to False as it's used based on input modality. + # Hence set to False to avoid any issues in the test irrespective of inputs. + processor.use_default_system_prompt = False processor.save_pretrained(self.tmpdirname) def get_tokenizer(self, **kwargs): @@ -53,11 +55,8 @@ class JanusProcessorTest(ProcessorTesterMixin, unittest.TestCase): def get_image_processor(self, **kwargs): return AutoProcessor.from_pretrained(self.tmpdirname, **kwargs).image_processor - def prepare_processor_dict(self): - # similar to Emu3 and Qwen2VLProcessorTest, but keep the template in the convert script to avoid duplicated code - return { - "chat_template": CHAT_TEMPLATE, - } + def get_processor(self): + return AutoProcessor.from_pretrained(self.tmpdirname) def test_chat_template_single(self): """