Don't use LayoutLMv2 and LayoutLMv3 in some pipeline tests (#22774)
* fix --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -273,33 +273,11 @@ class LayoutLMv2ModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCa
|
||||
{
|
||||
"document-question-answering": LayoutLMv2ForQuestionAnswering,
|
||||
"feature-extraction": LayoutLMv2Model,
|
||||
"question-answering": LayoutLMv2ForQuestionAnswering,
|
||||
"text-classification": LayoutLMv2ForSequenceClassification,
|
||||
"token-classification": LayoutLMv2ForTokenClassification,
|
||||
"zero-shot": LayoutLMv2ForSequenceClassification,
|
||||
}
|
||||
if is_torch_available()
|
||||
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
|
||||
|
||||
return super().is_pipeline_test_to_skip(
|
||||
pipeline_test_casse_name, config_class, model_architecture, tokenizer_name, processor_name
|
||||
)
|
||||
|
||||
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