Avoid modeling tests run in pipeline CI jobs (#21911)
* rework is_pipeline_test * bring back 3 tests --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -215,7 +215,6 @@ class BridgeTowerModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestC
|
|||||||
config_and_inputs = self.model_tester.prepare_config_and_inputs()
|
config_and_inputs = self.model_tester.prepare_config_and_inputs()
|
||||||
self.model_tester.create_and_check_model(*config_and_inputs)
|
self.model_tester.create_and_check_model(*config_and_inputs)
|
||||||
|
|
||||||
@unittest.skip(reason="skip temporarily to avoid failure on `main`")
|
|
||||||
def test_for_image_and_text_retrieval(self):
|
def test_for_image_and_text_retrieval(self):
|
||||||
config_and_inputs = self.model_tester.prepare_config_and_inputs()
|
config_and_inputs = self.model_tester.prepare_config_and_inputs()
|
||||||
self.model_tester.create_and_check_for_image_and_text_retrieval(*config_and_inputs)
|
self.model_tester.create_and_check_for_image_and_text_retrieval(*config_and_inputs)
|
||||||
@@ -263,12 +262,7 @@ class BridgeTowerModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestC
|
|||||||
max_diff = np.amax(np.abs(out_1 - out_2))
|
max_diff = np.amax(np.abs(out_1 - out_2))
|
||||||
self.assertLessEqual(max_diff, 1e-5)
|
self.assertLessEqual(max_diff, 1e-5)
|
||||||
|
|
||||||
@unittest.skip(reason="skip temporarily to avoid failure on `main`")
|
|
||||||
def test_feed_forward_chunking(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Override this as `hidden states output` is different for BridgeTower
|
# Override this as `hidden states output` is different for BridgeTower
|
||||||
@unittest.skip(reason="skip temporarily to avoid failure on `main`")
|
|
||||||
def test_hidden_states_output(self):
|
def test_hidden_states_output(self):
|
||||||
def check_hidden_states_output(inputs_dict, config, model_class):
|
def check_hidden_states_output(inputs_dict, config, model_class):
|
||||||
model = model_class(config)
|
model = model_class(config)
|
||||||
|
|||||||
@@ -105,7 +105,6 @@ PATH_TO_TRANSFORMERS = os.path.join(Path(__file__).parent.parent, "src/transform
|
|||||||
transformers_module = direct_transformers_import(PATH_TO_TRANSFORMERS)
|
transformers_module = direct_transformers_import(PATH_TO_TRANSFORMERS)
|
||||||
|
|
||||||
|
|
||||||
@is_pipeline_test
|
|
||||||
class PipelineTesterMixin:
|
class PipelineTesterMixin:
|
||||||
model_tester = None
|
model_tester = None
|
||||||
pipeline_model_mapping = None
|
pipeline_model_mapping = None
|
||||||
@@ -279,102 +278,127 @@ class PipelineTesterMixin:
|
|||||||
|
|
||||||
run_batch_test(pipeline, examples)
|
run_batch_test(pipeline, examples)
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
@require_torch
|
@require_torch
|
||||||
def test_pipeline_audio_classification(self):
|
def test_pipeline_audio_classification(self):
|
||||||
self.run_task_tests(task="audio-classification")
|
self.run_task_tests(task="audio-classification")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
def test_pipeline_automatic_speech_recognition(self):
|
def test_pipeline_automatic_speech_recognition(self):
|
||||||
self.run_task_tests(task="automatic-speech-recognition")
|
self.run_task_tests(task="automatic-speech-recognition")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
def test_pipeline_conversational(self):
|
def test_pipeline_conversational(self):
|
||||||
self.run_task_tests(task="conversational")
|
self.run_task_tests(task="conversational")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
@require_vision
|
@require_vision
|
||||||
@require_timm
|
@require_timm
|
||||||
@require_torch
|
@require_torch
|
||||||
def test_pipeline_depth_estimation(self):
|
def test_pipeline_depth_estimation(self):
|
||||||
self.run_task_tests(task="depth-estimation")
|
self.run_task_tests(task="depth-estimation")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
@require_pytesseract
|
@require_pytesseract
|
||||||
@require_torch
|
@require_torch
|
||||||
@require_vision
|
@require_vision
|
||||||
def test_pipeline_document_question_answering(self):
|
def test_pipeline_document_question_answering(self):
|
||||||
self.run_task_tests(task="document-question-answering")
|
self.run_task_tests(task="document-question-answering")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
def test_pipeline_feature_extraction(self):
|
def test_pipeline_feature_extraction(self):
|
||||||
self.run_task_tests(task="feature-extraction")
|
self.run_task_tests(task="feature-extraction")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
def test_pipeline_fill_mask(self):
|
def test_pipeline_fill_mask(self):
|
||||||
self.run_task_tests(task="fill-mask")
|
self.run_task_tests(task="fill-mask")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
@require_torch_or_tf
|
@require_torch_or_tf
|
||||||
@require_vision
|
@require_vision
|
||||||
def test_pipeline_image_classification(self):
|
def test_pipeline_image_classification(self):
|
||||||
self.run_task_tests(task="image-classification")
|
self.run_task_tests(task="image-classification")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
@require_vision
|
@require_vision
|
||||||
@require_timm
|
@require_timm
|
||||||
@require_torch
|
@require_torch
|
||||||
def test_pipeline_image_segmentation(self):
|
def test_pipeline_image_segmentation(self):
|
||||||
self.run_task_tests(task="image-segmentation")
|
self.run_task_tests(task="image-segmentation")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
@require_vision
|
@require_vision
|
||||||
def test_pipeline_image_to_text(self):
|
def test_pipeline_image_to_text(self):
|
||||||
self.run_task_tests(task="image-to-text")
|
self.run_task_tests(task="image-to-text")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
@require_vision
|
@require_vision
|
||||||
@require_timm
|
@require_timm
|
||||||
@require_torch
|
@require_torch
|
||||||
def test_pipeline_object_detection(self):
|
def test_pipeline_object_detection(self):
|
||||||
self.run_task_tests(task="object-detection")
|
self.run_task_tests(task="object-detection")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
def test_pipeline_question_answering(self):
|
def test_pipeline_question_answering(self):
|
||||||
self.run_task_tests(task="question-answering")
|
self.run_task_tests(task="question-answering")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
def test_pipeline_summarization(self):
|
def test_pipeline_summarization(self):
|
||||||
self.run_task_tests(task="summarization")
|
self.run_task_tests(task="summarization")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
def test_pipeline_table_question_answering(self):
|
def test_pipeline_table_question_answering(self):
|
||||||
self.run_task_tests(task="table-question-answering")
|
self.run_task_tests(task="table-question-answering")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
def test_pipeline_text2text_generation(self):
|
def test_pipeline_text2text_generation(self):
|
||||||
self.run_task_tests(task="text2text-generation")
|
self.run_task_tests(task="text2text-generation")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
def test_pipeline_text_classification(self):
|
def test_pipeline_text_classification(self):
|
||||||
self.run_task_tests(task="text-classification")
|
self.run_task_tests(task="text-classification")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
@require_torch_or_tf
|
@require_torch_or_tf
|
||||||
def test_pipeline_text_generation(self):
|
def test_pipeline_text_generation(self):
|
||||||
self.run_task_tests(task="text-generation")
|
self.run_task_tests(task="text-generation")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
def test_pipeline_token_classification(self):
|
def test_pipeline_token_classification(self):
|
||||||
self.run_task_tests(task="token-classification")
|
self.run_task_tests(task="token-classification")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
def test_pipeline_translation(self):
|
def test_pipeline_translation(self):
|
||||||
self.run_task_tests(task="translation")
|
self.run_task_tests(task="translation")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
@require_torch_or_tf
|
@require_torch_or_tf
|
||||||
@require_vision
|
@require_vision
|
||||||
@require_decord
|
@require_decord
|
||||||
def test_pipeline_video_classification(self):
|
def test_pipeline_video_classification(self):
|
||||||
self.run_task_tests(task="video-classification")
|
self.run_task_tests(task="video-classification")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
@require_torch
|
@require_torch
|
||||||
@require_vision
|
@require_vision
|
||||||
def test_pipeline_visual_question_answering(self):
|
def test_pipeline_visual_question_answering(self):
|
||||||
self.run_task_tests(task="visual-question-answering")
|
self.run_task_tests(task="visual-question-answering")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
def test_pipeline_zero_shot(self):
|
def test_pipeline_zero_shot(self):
|
||||||
self.run_task_tests(task="zero-shot")
|
self.run_task_tests(task="zero-shot")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
@require_torch
|
@require_torch
|
||||||
def test_pipeline_zero_shot_audio_classification(self):
|
def test_pipeline_zero_shot_audio_classification(self):
|
||||||
self.run_task_tests(task="zero-shot-audio-classification")
|
self.run_task_tests(task="zero-shot-audio-classification")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
@require_vision
|
@require_vision
|
||||||
def test_pipeline_zero_shot_image_classification(self):
|
def test_pipeline_zero_shot_image_classification(self):
|
||||||
self.run_task_tests(task="zero-shot-image-classification")
|
self.run_task_tests(task="zero-shot-image-classification")
|
||||||
|
|
||||||
|
@is_pipeline_test
|
||||||
@require_vision
|
@require_vision
|
||||||
@require_torch
|
@require_torch
|
||||||
def test_pipeline_zero_shot_object_detection(self):
|
def test_pipeline_zero_shot_object_detection(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user