Move is_pipeline_test_to_skip to specific model test classes (#21999)
* Move `is_pipeline_test_to_skip` to specific model test classes --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -282,6 +282,29 @@ class LayoutLMv2ModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCa
|
||||
else {}
|
||||
)
|
||||
|
||||
# TODO: Fix the failed tests
|
||||
def is_pipeline_test_to_skip(
|
||||
self, pipeline_test_casse_name, config_class, model_architecture, tokenizer_name, processor_name
|
||||
):
|
||||
if pipeline_test_casse_name in [
|
||||
"QAPipelineTests",
|
||||
"TextClassificationPipelineTests",
|
||||
"TokenClassificationPipelineTests",
|
||||
"ZeroShotClassificationPipelineTests",
|
||||
]:
|
||||
# `LayoutLMv2Config` was never used in pipeline tests (`test_pt_LayoutLMv2Config_XXX`) due to lack of tiny
|
||||
# config. With new tiny model creation, it is available, but we need to fix the failed tests.
|
||||
return True
|
||||
elif (
|
||||
pipeline_test_casse_name == "DocumentQuestionAnsweringPipelineTests"
|
||||
and tokenizer_name is not None
|
||||
and not tokenizer_name.endswith("Fast")
|
||||
):
|
||||
# This pipeline uses `sequence_ids()` which is only available for fast tokenizers.
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def setUp(self):
|
||||
self.model_tester = LayoutLMv2ModelTester(self)
|
||||
self.config_tester = ConfigTester(self, config_class=LayoutLMv2Config, hidden_size=37)
|
||||
|
||||
Reference in New Issue
Block a user