from ...configuration_utils import PretrainedConfig
from ...utils import logging


a_							=      logging.get_logger(__name__)

a_							=      {
    """naver-clova-ix/donut-base""": """https://huggingface.co/naver-clova-ix/donut-base/resolve/main/config.json""",
    # See all Donut models at https://huggingface.co/models?filter=donut-swin
}


class 			UpperCAmelCase__    (		snake_case					):



  """simple docstring"""






  lowerCAmelCase__		:	List[str]    		= 'donut-swin'

  lowerCAmelCase__		:	Optional[Any]    		= {
      'num_attention_heads': 'num_heads',
      'num_hidden_layers': 'num_layers',
  }






  def __init__(				self:			str				,				__lowerCAmelCase:			int=224				,				__lowerCAmelCase:			Optional[Any]=4				,				__lowerCAmelCase:			List[str]=3				,				__lowerCAmelCase:			Union[str, Any]=96				,				__lowerCAmelCase:			List[Any]=[2, 2, 6, 2]				,				__lowerCAmelCase:			Union[str, Any]=[3, 6, 12, 24]				,				__lowerCAmelCase:			Optional[Any]=7				,				__lowerCAmelCase:			Optional[int]=4.0				,				__lowerCAmelCase:			Optional[int]=True				,				__lowerCAmelCase:			int=0.0				,				__lowerCAmelCase:			int=0.0				,				__lowerCAmelCase:			List[Any]=0.1				,				__lowerCAmelCase:			Optional[Any]="gelu"				,				__lowerCAmelCase:			Optional[Any]=False				,				__lowerCAmelCase:			Optional[int]=0.02				,				__lowerCAmelCase:			Any=1E-5				,				**__lowerCAmelCase:			Union[str, Any]				,				) -> List[Any]:




    '''simple docstring'''




    super().__init__(**__lowerCAmelCase   )

    __UpperCAmelCase						    =       image_size
    __UpperCAmelCase						    =       patch_size
    __UpperCAmelCase						    =       num_channels
    __UpperCAmelCase						    =       embed_dim
    __UpperCAmelCase						    =       depths
    __UpperCAmelCase						    =       len(__lowerCAmelCase   )
    __UpperCAmelCase						    =       num_heads
    __UpperCAmelCase						    =       window_size
    __UpperCAmelCase						    =       mlp_ratio
    __UpperCAmelCase						    =       qkv_bias
    __UpperCAmelCase						    =       hidden_dropout_prob
    __UpperCAmelCase						    =       attention_probs_dropout_prob
    __UpperCAmelCase						    =       drop_path_rate
    __UpperCAmelCase						    =       hidden_act
    __UpperCAmelCase						    =       use_absolute_embeddings
    __UpperCAmelCase						    =       layer_norm_eps
    __UpperCAmelCase						    =       initializer_range
    # we set the hidden_size attribute in order to make Swin work with VisionEncoderDecoderModel
    # this indicates the channel dimension after the last stage of the model
    __UpperCAmelCase						    =       int(embed_dim * 2 ** (len(__lowerCAmelCase   ) - 1)   )




from ..utils import DummyObject, requires_backends


class 			UpperCAmelCase__    (		metaclass=snake_case					):



  """simple docstring"""






  lowerCAmelCase__		:	List[str]    		= ['transformers', 'torch', 'note_seq']






  def __init__(				self:			List[str]				,				*__lowerCAmelCase:			Optional[int]				,				**__lowerCAmelCase:			List[Any]   ) -> Optional[int]:




    '''simple docstring'''




    requires_backends(self				,				["transformers", "torch", "note_seq"]   )






  @classmethod
  def 	_UpperCAmelCase				(				cls:			Optional[int]				,				*__lowerCAmelCase:			Any				,				**__lowerCAmelCase:			List[str]   ) -> Dict:




    '''simple docstring'''




    requires_backends(cls				,				["transformers", "torch", "note_seq"]   )






  @classmethod
  def 	_UpperCAmelCase				(				cls:			Union[str, Any]				,				*__lowerCAmelCase:			Optional[Any]				,				**__lowerCAmelCase:			Optional[Any]   ) -> Any:




    '''simple docstring'''




    requires_backends(cls				,				["transformers", "torch", "note_seq"]   )



