






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      (snake_case_			):







		'''simple docstring'''



		_snake_case    :    Tuple       						=  '''trocr'''
		_snake_case    :    List[str]       						=  ['''past_key_values''']
		_snake_case    :    Optional[int]       						=  {
		    '''num_attention_heads''': '''decoder_attention_heads''',
		    '''hidden_size''': '''d_model''',
		    '''num_hidden_layers''': '''decoder_layers''',
		}



		def __init__(							self				,		_UpperCamelCase=5_0_2_6_5				,		_UpperCamelCase=1_0_2_4				,		_UpperCamelCase=1_2				,		_UpperCamelCase=1_6				,		_UpperCamelCase=4_0_9_6				,		_UpperCamelCase="gelu"				,		_UpperCamelCase=5_1_2				,		_UpperCamelCase=0.1				,		_UpperCamelCase=0.0				,		_UpperCamelCase=0.0				,		_UpperCamelCase=2				,		_UpperCamelCase=0.02				,		_UpperCamelCase=0.0				,		_UpperCamelCase=True				,		_UpperCamelCase=False				,		_UpperCamelCase=True				,		_UpperCamelCase=True				,		_UpperCamelCase=1				,		_UpperCamelCase=0				,		_UpperCamelCase=2				,		**_UpperCamelCase				,		)	->							Tuple:
							UpperCAmelCase_    :      str            =						vocab_size
							UpperCAmelCase_    :      str            =						d_model
							UpperCAmelCase_    :      List[Any]            =						decoder_layers
							UpperCAmelCase_    :      Any            =						decoder_attention_heads
							UpperCAmelCase_    :      Tuple            =						decoder_ffn_dim
							UpperCAmelCase_    :      Optional[Any]            =						activation_function
							UpperCAmelCase_    :      List[str]            =						max_position_embeddings
							UpperCAmelCase_    :      Optional[int]            =						dropout
							UpperCAmelCase_    :      Optional[Any]            =						attention_dropout
							UpperCAmelCase_    :      Dict            =						activation_dropout
							UpperCAmelCase_    :      str            =						init_std
							UpperCAmelCase_    :      Dict            =						decoder_layerdrop
							UpperCAmelCase_    :      List[str]            =						use_cache
							UpperCAmelCase_    :      str            =						scale_embedding
							UpperCAmelCase_    :      List[str]            =						use_learned_position_embeddings
							UpperCAmelCase_    :      Optional[Any]            =						layernorm_embedding

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







from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_torch_available,
    is_vision_available,
)


a_    					=       {
    'configuration_efficientformer': [
        'EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'EfficientFormerConfig',
    ]
}

try:
   if not is_vision_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   a_    					=       ['EfficientFormerImageProcessor']

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   a_    					=       [
       'EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
       'EfficientFormerForImageClassification',
       'EfficientFormerForImageClassificationWithTeacher',
       'EfficientFormerModel',
       'EfficientFormerPreTrainedModel',
   ]

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   a_    					=       [
       'TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
       'TFEfficientFormerForImageClassification',
       'TFEfficientFormerForImageClassificationWithTeacher',
       'TFEfficientFormerModel',
       'TFEfficientFormerPreTrainedModel',
   ]

if TYPE_CHECKING:
   from .configuration_efficientformer import EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, EfficientFormerConfig

   try:
      if not is_vision_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .image_processing_efficientformer import EfficientFormerImageProcessor

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_efficientformer import (
          EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
          EfficientFormerForImageClassification,
          EfficientFormerForImageClassificationWithTeacher,
          EfficientFormerModel,
          EfficientFormerPreTrainedModel,
      )
   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_efficientformer import (
          TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFEfficientFormerForImageClassification,
          TFEfficientFormerForImageClassificationWithTeacher,
          TFEfficientFormerModel,
          TFEfficientFormerPreTrainedModel,
      )

else:
   import sys

   a_    					=       _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)



