
"""simple docstring"""


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


lowerCAmelCase			=		logging.get_logger(__name__)

lowerCAmelCase			=		{
    """google/reformer-crime-and-punishment""": (
        """https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/config.json"""
    ),
    """google/reformer-enwik8""": """https://huggingface.co/google/reformer-enwik8/resolve/main/config.json""",
}

class 					A_			(  lowerCamelCase_     ):
							SCREAMING_SNAKE_CASE_			   =     """reformer"""
							SCREAMING_SNAKE_CASE_			   =     ["""past_buckets_states"""]
							SCREAMING_SNAKE_CASE_			   =     {}





							def __init__(						self						:Union[str, Any]  ,							lowerCamelCase_						:int=64  ,							lowerCamelCase_						:Union[str, Any]=["local", "lsh", "local", "lsh", "local", "lsh"]  ,							lowerCamelCase_						:List[Any]=1.0  ,							lowerCamelCase_						:Any=True  ,							lowerCamelCase_						:List[str]=[64, 64]  ,							lowerCamelCase_						:Tuple=[64, 192]  ,							lowerCamelCase_						:Optional[int]=0  ,							lowerCamelCase_						:List[Any]=2  ,							lowerCamelCase_						:Any=512  ,							lowerCamelCase_						:Any=None  ,							lowerCamelCase_						:str="relu"  ,							lowerCamelCase_						:Any=0.05  ,							lowerCamelCase_						:Dict=256  ,							lowerCamelCase_						:Any=0.02  ,							lowerCamelCase_						:List[Any]=False  ,							lowerCamelCase_						:Optional[Any]=1e-12  ,							lowerCamelCase_						:Union[str, Any]=1  ,							lowerCamelCase_						:Union[str, Any]=0  ,							lowerCamelCase_						:Dict=0.05  ,							lowerCamelCase_						:int=64  ,							lowerCamelCase_						:Tuple=64  ,							lowerCamelCase_						:Tuple=0.0  ,							lowerCamelCase_						:Tuple=1  ,							lowerCamelCase_						:Optional[int]=0  ,							lowerCamelCase_						:Any=4_096  ,							lowerCamelCase_						:Tuple=12  ,							lowerCamelCase_						:Optional[int]=None  ,							lowerCamelCase_						:int=1  ,							lowerCamelCase_						:Optional[int]=0  ,							lowerCamelCase_						:List[Any]=320  ,							lowerCamelCase_						:Dict=False  ,							lowerCamelCase_						:Optional[Any]=True  ,							lowerCamelCase_						:Any=None  ,							**lowerCamelCase_						:Union[str, Any]  ,							):





										"""simple docstring"""

										lowerCamelCase__			:  List[str]  =hash_seed
										lowerCamelCase__			:  Union[str, Any]  =vocab_size
										lowerCamelCase__			:  Optional[Any]  =attention_head_size
										lowerCamelCase__			:  Optional[int]  =hidden_size
										lowerCamelCase__			:  Union[str, Any]  =num_attention_heads
										lowerCamelCase__			:  List[str]  =num_hashes
										lowerCamelCase__			:  str  =len(lowerCamelCase_ )
										lowerCamelCase__			:  str  =tuple(lowerCamelCase_ ) if isinstance(lowerCamelCase_  ,							lowerCamelCase_ ) else num_buckets
										lowerCamelCase__			:  int  =lsh_attn_chunk_length
										lowerCamelCase__			:  List[str]  =local_attn_chunk_length
										lowerCamelCase__			:  Any  =lsh_num_chunks_after
										lowerCamelCase__			:  Union[str, Any]  =lsh_num_chunks_before
										lowerCamelCase__			:  Tuple  =local_num_chunks_after
										lowerCamelCase__			:  Optional[int]  =local_num_chunks_before
										lowerCamelCase__			:  Tuple  =hidden_act
										lowerCamelCase__			:  List[str]  =feed_forward_size
										lowerCamelCase__			:  Tuple  =hidden_dropout_prob
										lowerCamelCase__			:  Optional[Any]  =lsh_attention_probs_dropout_prob
										lowerCamelCase__			:  Any  =local_attention_probs_dropout_prob
										lowerCamelCase__			:  List[Any]  =max_position_embeddings
										lowerCamelCase__			:  Tuple  =initializer_range
										lowerCamelCase__			:  Union[str, Any]  =layer_norm_eps
										lowerCamelCase__			:  str  =axial_pos_embds
										lowerCamelCase__			:  List[str]  =tuple(lowerCamelCase_ )
										lowerCamelCase__			:  List[Any]  =tuple(lowerCamelCase_ )
										lowerCamelCase__			:  int  =axial_norm_std
										lowerCamelCase__			:  List[Any]  =chunk_size_lm_head
										lowerCamelCase__			:  Optional[Any]  =attn_layers
										lowerCamelCase__			:  int  =use_cache
										lowerCamelCase__			:  Any  =classifier_dropout
										super().__init__(
										    pad_token_id=lowerCamelCase_  ,							eos_token_id=lowerCamelCase_  ,							is_decoder=lowerCamelCase_  ,							tie_word_embeddings=lowerCamelCase_  ,							**lowerCamelCase_  ,							)

"""simple docstring"""


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


lowerCAmelCase			=		{
    """configuration_donut_swin""": ["""DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP""", """DonutSwinConfig"""],
    """processing_donut""": ["""DonutProcessor"""],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							lowerCAmelCase			=		[
							    """DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST""",
							    """DonutSwinModel""",
							    """DonutSwinPreTrainedModel""",
							]

try:
							if not is_vision_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							lowerCAmelCase			=		["""DonutFeatureExtractor"""]
							lowerCAmelCase			=		["""DonutImageProcessor"""]


if TYPE_CHECKING:
							from .configuration_donut_swin import DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, DonutSwinConfig
							from .processing_donut import DonutProcessor

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_donut_swin import (
														    DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
														    DonutSwinModel,
														    DonutSwinPreTrainedModel,
														)

							try:
														if not is_vision_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .feature_extraction_donut import DonutFeatureExtractor
														from .image_processing_donut import DonutImageProcessor

else:
							import sys

							lowerCAmelCase			=		_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)