From fa44bab75104c216e230d7e7e8280468b52c4177 Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 22 Jan 2024 12:51:16 +0000 Subject: [PATCH] Fix missing bbox in LayoutLM signature --- src/transformers/models/layoutlm/modeling_tf_layoutlm.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/transformers/models/layoutlm/modeling_tf_layoutlm.py b/src/transformers/models/layoutlm/modeling_tf_layoutlm.py index b6c765851213bd..f5edb52520045b 100644 --- a/src/transformers/models/layoutlm/modeling_tf_layoutlm.py +++ b/src/transformers/models/layoutlm/modeling_tf_layoutlm.py @@ -944,6 +944,12 @@ class TFLayoutLMPreTrainedModel(TFPreTrainedModel): config_class = LayoutLMConfig base_model_prefix = "layoutlm" + @property + def input_signature(self): + signature = super().input_signature + signature["bbox"] = tf.TensorSpec(shape=(None, None, 4), dtype=tf.int32, name="bbox") + return signature + LAYOUTLM_START_DOCSTRING = r"""