LayoutXLM load pretrain with 2048 max_position_embeddings

Hello,
I’m trying to change the preload model configuration in order to fine tune it on sequence of 2048 max embeddings.

I could not figure it out how to load. By simply modify the config value it throw an error, as the pretrained model is expecting a 1, 514 size tensor.

Any suggestions
THank you in advance