From a1100fac67a7c88440e763049b86dd2c9f0bd715 Mon Sep 17 00:00:00 2001 From: Lysandre Debut Date: Tue, 12 Jan 2021 10:03:50 -0500 Subject: [PATCH] LayoutLM Config (#9539) --- src/transformers/models/auto/modeling_auto.py | 2 +- tests/test_modeling_auto.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transformers/models/auto/modeling_auto.py b/src/transformers/models/auto/modeling_auto.py index 8c34ebe5d8..77422bc3cb 100644 --- a/src/transformers/models/auto/modeling_auto.py +++ b/src/transformers/models/auto/modeling_auto.py @@ -460,6 +460,7 @@ MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING = OrderedDict( (LongformerConfig, LongformerForSequenceClassification), (RobertaConfig, RobertaForSequenceClassification), (SqueezeBertConfig, SqueezeBertForSequenceClassification), + (LayoutLMConfig, LayoutLMForSequenceClassification), (BertConfig, BertForSequenceClassification), (XLNetConfig, XLNetForSequenceClassification), (MobileBertConfig, MobileBertForSequenceClassification), @@ -475,7 +476,6 @@ MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING = OrderedDict( (TransfoXLConfig, TransfoXLForSequenceClassification), (MPNetConfig, MPNetForSequenceClassification), (TapasConfig, TapasForSequenceClassification), - (LayoutLMConfig, LayoutLMForSequenceClassification), ] ) diff --git a/tests/test_modeling_auto.py b/tests/test_modeling_auto.py index edd9ceebc1..d395d9640d 100644 --- a/tests/test_modeling_auto.py +++ b/tests/test_modeling_auto.py @@ -241,7 +241,7 @@ class AutoModelTest(unittest.TestCase): for parent_config, parent_model in mapping[: index + 1]: assert not issubclass( child_config, parent_config - ), "{child_config.__name__} is child of {parent_config.__name__}" + ), f"{child_config.__name__} is child of {parent_config.__name__}" assert not issubclass( child_model, parent_model - ), "{child_config.__name__} is child of {parent_config.__name__}" + ), f"{child_config.__name__} is child of {parent_config.__name__}"