mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-03 21:00:08 +06:00
[Tests] Cleanup Janus Testcase (#38311)
* Cleanup janus testcase * shift code to setup
This commit is contained in:
parent
b59386dc0a
commit
2b585419b4
@ -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):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user