code: def get_configs(model):
      original_config = model.config
  
      encoder_config = DonutSwinConfig(
          image_size=original_config.input_size,
          patch_size=4,
          depths=original_config.encoder_layer,
          num_heads=[4, 8, 16, 32],
          window_size=original_config.window_size,
          embed_dim=128,
      )
      decoder_config = MBartConfig(
          is_decoder=True,
          is_encoder_decoder=False,
          add_cross_attention=True,
          decoder_layers=original_config.decoder_layer,
          max_position_embeddings=original_config.max_position_embeddings,
          vocab_size=len(
              model.decoder.tokenizer
          ),  # several special tokens are added to the vocab of XLMRobertaTokenizer, see repo on the hub (added_tokens.json)
          scale_embedding=True,
          add_final_layer_norm=True,
      )
  
      return encoder_config, decoder_config
  
file_path: transformers/src/transformers/models/donut/convert_donut_to_pytorch.py
imports: import argparse
  import torch
  from datasets import load_dataset
  from donut import DonutModel
  from transformers import DonutImageProcessor, DonutProcessor, DonutSwinConfig, DonutSwinModel, MBartConfig, MBartForCausalLM, VisionEncoderDecoderModel, XLMRobertaTokenizerFast
label_desc: Use image node_id 1 for calling a global function with example usage: get_configs(model) and returns: encoder_config,  decoder_config