runtime error

You are using a model of type layoutlm to instantiate a model of type layoutlmv2. This is not supported for all configurations of models and can yield errors. Traceback (most recent call last): File "/home/user/app/app.py", line 8, in <module> model = LayoutLMv2ForQuestionAnswering.from_pretrained(model_name) File "/usr/local/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3626, in from_pretrained model = cls(config, *model_args, **model_kwargs) File "/usr/local/lib/python3.10/site-packages/transformers/models/layoutlmv2/modeling_layoutlmv2.py", line 1267, in __init__ self.layoutlmv2 = LayoutLMv2Model(config) File "/usr/local/lib/python3.10/site-packages/transformers/models/layoutlmv2/modeling_layoutlmv2.py", line 690, in __init__ requires_backends(self, "detectron2") File "/usr/local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1463, in requires_backends raise ImportError("".join(failed)) ImportError: LayoutLMv2Model requires the detectron2 library but it was not found in your environment. Checkout the instructions on the installation page: https://github.com/facebookresearch/detectron2/blob/master/INSTALL.md and follow the ones that match your environment. Please note that you may need to restart your runtime after installation.

Container logs:

Fetching error logs...