'''simple docstring'''






from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


_UpperCAmelCase    :     List[str]         =       logging.get_logger(__name__)

_UpperCAmelCase    :     List[str]         =       {
    '''google/vit-base-patch16-224''': '''https://huggingface.co/vit-base-patch16-224/resolve/main/config.json''',
    # See all ViT models at https://huggingface.co/models?filter=vit
}







class lowercase_       (		_UpperCamelCase			):







   """simple docstring"""

   __lowerCAmelCase         =   "vit"
   def __init__(      self      :			List[str], UpperCamelCase__      :			Optional[int]=7_68, UpperCamelCase__      :			Union[str, Any]=12, UpperCamelCase__      :			str=12, UpperCamelCase__      :			int=30_72, UpperCamelCase__      :			List[str]="gelu", UpperCamelCase__      :			Dict=0.0, UpperCamelCase__      :			str=0.0, UpperCamelCase__      :			List[Any]=0.02, UpperCamelCase__      :			str=1e-12, UpperCamelCase__      :			Optional[Any]=2_24, UpperCamelCase__      :			Optional[Any]=16, UpperCamelCase__      :			int=3, UpperCamelCase__      :			Tuple=True, UpperCamelCase__      :			Tuple=16, **UpperCamelCase__      :			List[Any], )  ->			int:
        super().__init__(**UpperCamelCase__     )

        _A    		=  hidden_size
        _A    		=  num_hidden_layers
        _A    		=  num_attention_heads
        _A    		=  intermediate_size
        _A    		=  hidden_act
        _A    		=  hidden_dropout_prob
        _A    		=  attention_probs_dropout_prob
        _A    		=  initializer_range
        _A    		=  layer_norm_eps
        _A    		=  image_size
        _A    		=  patch_size
        _A    		=  num_channels
        _A    		=  qkv_bias
        _A    		=  encoder_stride







class lowercase_       (		_UpperCamelCase			):







   """simple docstring"""

   __lowerCAmelCase         =   version.parse("1.11"			)
   @property
   def 	__UpperCAmelCase   (      self      :			Union[str, Any]     )  ->			Mapping[str, Mapping[int, str]]:
        return OrderedDict(
            [
                ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
            ]     )

   @property
   def 	__UpperCAmelCase   (      self      :			Optional[int]     )  ->			float:
        return 1e-4







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


__UpperCamelCase     		=							logging.get_logger(__name__)

__UpperCamelCase     		=							{
    'microsoft/trocr-base-handwritten': (
        'https://huggingface.co/microsoft/trocr-base-handwritten/resolve/main/config.json'
    ),
    # See all TrOCR models at https://huggingface.co/models?filter=trocr
}







class 							lowerCamelCase__						(				UpperCAmelCase   ):






			"""simple docstring"""






			_UpperCamelCase		:       Dict 			=		'trocr'
			_UpperCamelCase		:       Union[str, Any] 			=		['past_key_values']
			_UpperCamelCase		:       Union[str, Any] 			=		{
			    'num_attention_heads': 'decoder_attention_heads',
			    'hidden_size': 'd_model',
			    'num_hidden_layers': 'decoder_layers',
			}




			def __init__(				self   ,    snake_case=50265   ,    snake_case=1024   ,    snake_case=12   ,    snake_case=16   ,    snake_case=4096   ,    snake_case="gelu"   ,    snake_case=512   ,    snake_case=0.1   ,    snake_case=0.0   ,    snake_case=0.0   ,    snake_case=2   ,    snake_case=0.02   ,    snake_case=0.0   ,    snake_case=True   ,    snake_case=False   ,    snake_case=True   ,    snake_case=True   ,    snake_case=1   ,    snake_case=0   ,    snake_case=2   ,    **snake_case   ,    ):

						'''simple docstring'''


						UpperCamelCase__       =							vocab_size
						UpperCamelCase__       =							d_model
						UpperCamelCase__       =							decoder_layers
						UpperCamelCase__       =							decoder_attention_heads
						UpperCamelCase__       =							decoder_ffn_dim
						UpperCamelCase__       =							activation_function
						UpperCamelCase__       =							max_position_embeddings
						UpperCamelCase__       =							dropout
						UpperCamelCase__       =							attention_dropout
						UpperCamelCase__       =							activation_dropout
						UpperCamelCase__       =							init_std
						UpperCamelCase__       =							decoder_layerdrop
						UpperCamelCase__       =							use_cache
						UpperCamelCase__       =							scale_embedding
						UpperCamelCase__       =							use_learned_position_embeddings
						UpperCamelCase__       =							layernorm_embedding

						super().__init__(
						    pad_token_id=snake_case   ,    bos_token_id=snake_case   ,    eos_token_id=snake_case   ,    decoder_start_token_id=snake_case   ,    **snake_case   ,    )


