Skip to content

Commit

Permalink
Do not add ProcessorTesterMixin everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
tibor-reiss committed Dec 19, 2024
1 parent d92cd4b commit 6f24d6c
Showing 1 changed file with 11 additions and 35 deletions.
46 changes: 11 additions & 35 deletions tests/models/sam/test_processor_sam.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
)
from transformers.utils import is_tf_available, is_torch_available, is_vision_available

from ...test_processing_common import ProcessorTesterMixin
from ...test_processing_common import ProcessorTesterMixin, prepare_image_inputs


if is_vision_available():
Expand Down Expand Up @@ -164,9 +164,7 @@ def test_post_process_masks(self):

@require_vision
@require_tf
class TFSamProcessorTest(ProcessorTesterMixin, unittest.TestCase):
processor_class = SamProcessor

class TFSamProcessorTest(unittest.TestCase):
def setUp(self):
self.tmpdirname = tempfile.mkdtemp()
image_processor = SamImageProcessor()
Expand All @@ -179,20 +177,10 @@ def get_image_processor(self, **kwargs):
def tearDown(self):
shutil.rmtree(self.tmpdirname)

def test_chat_template_save_loading(self):
self.skipTest("SamProcessor does not have a tokenizer")

def test_image_processor_defaults_preserved_by_image_kwargs(self):
self.skipTest("SamProcessor does not have a tokenizer")

def test_kwargs_overrides_default_image_processor_kwargs(self):
self.skipTest("SamProcessor does not have a tokenizer")

def test_kwargs_overrides_default_tokenizer_kwargs(self):
self.skipTest("SamProcessor does not have a tokenizer")

def test_tokenizer_defaults_preserved_by_kwargs(self):
self.skipTest("SamProcessor does not have a tokenizer")
# This is to avoid repeating the skipping of the common tests
def prepare_image_inputs(self):
"""This function prepares a list of PIL images."""
return prepare_image_inputs()

def test_save_load_pretrained_additional_features(self):
processor = SamProcessor(image_processor=self.get_image_processor())
Expand Down Expand Up @@ -259,9 +247,7 @@ def test_post_process_masks(self):

@require_vision
@require_torchvision
class SamProcessorEquivalenceTest(ProcessorTesterMixin, unittest.TestCase):
processor_class = SamProcessor

class SamProcessorEquivalenceTest(unittest.TestCase):
def setUp(self):
self.tmpdirname = tempfile.mkdtemp()
image_processor = SamImageProcessor()
Expand All @@ -274,20 +260,10 @@ def get_image_processor(self, **kwargs):
def tearDown(self):
shutil.rmtree(self.tmpdirname)

def test_chat_template_save_loading(self):
self.skipTest("SamProcessor does not have a tokenizer")

def test_image_processor_defaults_preserved_by_image_kwargs(self):
self.skipTest("SamProcessor does not have a tokenizer")

def test_kwargs_overrides_default_image_processor_kwargs(self):
self.skipTest("SamProcessor does not have a tokenizer")

def test_kwargs_overrides_default_tokenizer_kwargs(self):
self.skipTest("SamProcessor does not have a tokenizer")

def test_tokenizer_defaults_preserved_by_kwargs(self):
self.skipTest("SamProcessor does not have a tokenizer")
# This is to avoid repeating the skipping of the common tests
def prepare_image_inputs(self):
"""This function prepares a list of PIL images."""
return prepare_image_inputs()

@is_pt_tf_cross_test
def test_post_process_masks_equivalence(self):
Expand Down

0 comments on commit 6f24d6c

Please sign in to comment.