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


lowerCamelCase_						: Optional[int]         =  logging.get_logger(__name__)

lowerCamelCase_						: int         =  {
    """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        _UpperCamelCase				(					_A  ):






			'''simple docstring'''

			__UpperCamelCase      :						str					      = """trocr"""
			__UpperCamelCase      :						List[Any]					      = ["""past_key_values"""]
			__UpperCamelCase      :						int					      = {
			    """num_attention_heads""": """decoder_attention_heads""",
			    """hidden_size""": """d_model""",
			    """num_hidden_layers""": """decoder_layers""",
			}

			def __init__(       self :       Union[str, Any]						,	snake_case_ :       Tuple=5_0265						,	snake_case_ :       Dict=1024						,	snake_case_ :       str=12						,	snake_case_ :       int=16						,	snake_case_ :       Optional[Any]=4096						,	snake_case_ :       Optional[int]="gelu"						,	snake_case_ :       List[Any]=512						,	snake_case_ :       List[Any]=0.1						,	snake_case_ :       Union[str, Any]=0.0						,	snake_case_ :       str=0.0						,	snake_case_ :       List[Any]=2						,	snake_case_ :       Optional[int]=0.02						,	snake_case_ :       Dict=0.0						,	snake_case_ :       List[str]=True						,	snake_case_ :       Optional[int]=False						,	snake_case_ :       Union[str, Any]=True						,	snake_case_ :       Optional[Any]=True						,	snake_case_ :       str=1						,	snake_case_ :       Tuple=0						,	snake_case_ :       Optional[Any]=2						,	**snake_case_ :       str						,	):
							UpperCamelCase_:							Dict	=						vocab_size
							UpperCamelCase_:							Any	=						d_model
							UpperCamelCase_:							Union[str, Any]	=						decoder_layers
							UpperCamelCase_:							str	=						decoder_attention_heads
							UpperCamelCase_:							int	=						decoder_ffn_dim
							UpperCamelCase_:							Union[str, Any]	=						activation_function
							UpperCamelCase_:							Any	=						max_position_embeddings
							UpperCamelCase_:							Tuple	=						dropout
							UpperCamelCase_:							Union[str, Any]	=						attention_dropout
							UpperCamelCase_:							Union[str, Any]	=						activation_dropout
							UpperCamelCase_:							int	=						init_std
							UpperCamelCase_:							List[str]	=						decoder_layerdrop
							UpperCamelCase_:							int	=						use_cache
							UpperCamelCase_:							Tuple	=						scale_embedding
							UpperCamelCase_:							List[str]	=						use_learned_position_embeddings
							UpperCamelCase_:							Dict	=						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_						,	)








import os

from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE, hf_cache_home


lowerCamelCase_						: Optional[int]         =  HUGGINGFACE_HUB_CACHE


lowerCamelCase_						: List[str]         =  """config.json"""
lowerCamelCase_						: Any         =  """diffusion_pytorch_model.bin"""
lowerCamelCase_						: Union[str, Any]         =  """diffusion_flax_model.msgpack"""
lowerCamelCase_						: Dict         =  """model.onnx"""
lowerCamelCase_						: List[Any]         =  """diffusion_pytorch_model.safetensors"""
lowerCamelCase_						: Optional[Any]         =  """weights.pb"""
lowerCamelCase_						: Optional[Any]         =  """https://huggingface.co"""
lowerCamelCase_						: Union[str, Any]         =  default_cache_path
lowerCamelCase_						: Tuple         =  """diffusers_modules"""
lowerCamelCase_						: Optional[Any]         =  os.getenv("""HF_MODULES_CACHE""", os.path.join(hf_cache_home, """modules"""))
lowerCamelCase_						: str         =  ["""fp16""", """non-ema"""]
lowerCamelCase_						: List[Any]         =  """.self_attn"""






