Skip to content

Commit

Permalink
Avoid modeling tests run in pipeline CI jobs (#21911)
Browse files Browse the repository at this point in the history
* rework is_pipeline_test

* bring back 3 tests

---------

Co-authored-by: ydshieh <[email protected]>
  • Loading branch information
ydshieh and ydshieh authored Mar 2, 2023
1 parent db979f7 commit 9f5bfe1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
6 changes: 0 additions & 6 deletions tests/models/bridgetower/test_modeling_bridgetower.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ def test_model(self):
config_and_inputs = self.model_tester.prepare_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):
config_and_inputs = self.model_tester.prepare_config_and_inputs()
self.model_tester.create_and_check_for_image_and_text_retrieval(*config_and_inputs)
Expand Down Expand Up @@ -263,12 +262,7 @@ def test_save_load(self):
max_diff = np.amax(np.abs(out_1 - out_2))
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
@unittest.skip(reason="skip temporarily to avoid failure on `main`")
def test_hidden_states_output(self):
def check_hidden_states_output(inputs_dict, config, model_class):
model = model_class(config)
Expand Down
26 changes: 25 additions & 1 deletion tests/test_pipeline_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
transformers_module = direct_transformers_import(PATH_TO_TRANSFORMERS)


@is_pipeline_test
class PipelineTesterMixin:
model_tester = None
pipeline_model_mapping = None
Expand Down Expand Up @@ -279,102 +278,127 @@ def data(n):

run_batch_test(pipeline, examples)

@is_pipeline_test
@require_torch
def test_pipeline_audio_classification(self):
self.run_task_tests(task="audio-classification")

@is_pipeline_test
def test_pipeline_automatic_speech_recognition(self):
self.run_task_tests(task="automatic-speech-recognition")

@is_pipeline_test
def test_pipeline_conversational(self):
self.run_task_tests(task="conversational")

@is_pipeline_test
@require_vision
@require_timm
@require_torch
def test_pipeline_depth_estimation(self):
self.run_task_tests(task="depth-estimation")

@is_pipeline_test
@require_pytesseract
@require_torch
@require_vision
def test_pipeline_document_question_answering(self):
self.run_task_tests(task="document-question-answering")

@is_pipeline_test
def test_pipeline_feature_extraction(self):
self.run_task_tests(task="feature-extraction")

@is_pipeline_test
def test_pipeline_fill_mask(self):
self.run_task_tests(task="fill-mask")

@is_pipeline_test
@require_torch_or_tf
@require_vision
def test_pipeline_image_classification(self):
self.run_task_tests(task="image-classification")

@is_pipeline_test
@require_vision
@require_timm
@require_torch
def test_pipeline_image_segmentation(self):
self.run_task_tests(task="image-segmentation")

@is_pipeline_test
@require_vision
def test_pipeline_image_to_text(self):
self.run_task_tests(task="image-to-text")

@is_pipeline_test
@require_vision
@require_timm
@require_torch
def test_pipeline_object_detection(self):
self.run_task_tests(task="object-detection")

@is_pipeline_test
def test_pipeline_question_answering(self):
self.run_task_tests(task="question-answering")

@is_pipeline_test
def test_pipeline_summarization(self):
self.run_task_tests(task="summarization")

@is_pipeline_test
def test_pipeline_table_question_answering(self):
self.run_task_tests(task="table-question-answering")

@is_pipeline_test
def test_pipeline_text2text_generation(self):
self.run_task_tests(task="text2text-generation")

@is_pipeline_test
def test_pipeline_text_classification(self):
self.run_task_tests(task="text-classification")

@is_pipeline_test
@require_torch_or_tf
def test_pipeline_text_generation(self):
self.run_task_tests(task="text-generation")

@is_pipeline_test
def test_pipeline_token_classification(self):
self.run_task_tests(task="token-classification")

@is_pipeline_test
def test_pipeline_translation(self):
self.run_task_tests(task="translation")

@is_pipeline_test
@require_torch_or_tf
@require_vision
@require_decord
def test_pipeline_video_classification(self):
self.run_task_tests(task="video-classification")

@is_pipeline_test
@require_torch
@require_vision
def test_pipeline_visual_question_answering(self):
self.run_task_tests(task="visual-question-answering")

@is_pipeline_test
def test_pipeline_zero_shot(self):
self.run_task_tests(task="zero-shot")

@is_pipeline_test
@require_torch
def test_pipeline_zero_shot_audio_classification(self):
self.run_task_tests(task="zero-shot-audio-classification")

@is_pipeline_test
@require_vision
def test_pipeline_zero_shot_image_classification(self):
self.run_task_tests(task="zero-shot-image-classification")

@is_pipeline_test
@require_vision
@require_torch
def test_pipeline_zero_shot_object_detection(self):
Expand Down

0 comments on commit 9f5bfe1

Please sign in to comment.