





"""simple docstring"""





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


__A											=						logging.get_logger(__name__)

__A											=						{
    """transfo-xl-wt103""": """https://huggingface.co/transfo-xl-wt103/resolve/main/config.json""",
}






class    _lowerCAmelCase  (	a			):
       """simple docstring"""




       __magic_name__	:List[str]						    =   """transfo-xl"""
       __magic_name__	:Any						    =   ["""mems"""]
       __magic_name__	:List[str]						    =   {
           """n_token""": """vocab_size""",
           """hidden_size""": """d_model""",
           """num_attention_heads""": """n_head""",
           """num_hidden_layers""": """n_layer""",
       }






       def __init__(       self       ,					__UpperCAmelCase=2_6_7_7_3_5       ,					__UpperCAmelCase=[2_0_0_0_0, 4_0_0_0_0, 2_0_0_0_0_0]       ,					__UpperCAmelCase=1_0_2_4       ,					__UpperCAmelCase=1_0_2_4       ,					__UpperCAmelCase=1_6       ,					__UpperCAmelCase=6_4       ,					__UpperCAmelCase=4_0_9_6       ,					__UpperCAmelCase=4       ,					__UpperCAmelCase=False       ,					__UpperCAmelCase=1_8       ,					__UpperCAmelCase=1_6_0_0       ,					__UpperCAmelCase=1_0_0_0       ,					__UpperCAmelCase=True       ,					__UpperCAmelCase=True       ,					__UpperCAmelCase=0       ,					__UpperCAmelCase=-1       ,					__UpperCAmelCase=True       ,					__UpperCAmelCase=0.1       ,					__UpperCAmelCase=0.0       ,					__UpperCAmelCase=True       ,					__UpperCAmelCase="normal"       ,					__UpperCAmelCase=0.01       ,					__UpperCAmelCase=0.01       ,					__UpperCAmelCase=0.02       ,					__UpperCAmelCase=1E-5       ,					__UpperCAmelCase=0       ,					**__UpperCAmelCase       ,					):



         '''simple docstring'''

         lowerCAmelCase__     :List[str]											=				vocab_size
         lowerCAmelCase__     :Optional[int]											=				[]
         self.cutoffs.extend(__UpperCAmelCase )
         if proj_share_all_but_first:
           lowerCAmelCase__     :int											=				[False] + [True] * len(self.cutoffs )
         else:
           lowerCAmelCase__     :List[Any]											=				[False] + [False] * len(self.cutoffs )
         lowerCAmelCase__     :Union[str, Any]											=				d_model
         lowerCAmelCase__     :str											=				d_embed
         lowerCAmelCase__     :str											=				d_head
         lowerCAmelCase__     :List[str]											=				d_inner
         lowerCAmelCase__     :List[str]											=				div_val
         lowerCAmelCase__     :Optional[int]											=				pre_lnorm
         lowerCAmelCase__     :Union[str, Any]											=				n_layer
         lowerCAmelCase__     :Optional[Any]											=				n_head
         lowerCAmelCase__     :Optional[int]											=				mem_len
         lowerCAmelCase__     :Optional[Any]											=				same_length
         lowerCAmelCase__     :Any											=				attn_type
         lowerCAmelCase__     :Union[str, Any]											=				clamp_len
         lowerCAmelCase__     :List[Any]											=				sample_softmax
         lowerCAmelCase__     :Any											=				adaptive
         lowerCAmelCase__     :Union[str, Any]											=				dropout
         lowerCAmelCase__     :Optional[Any]											=				dropatt
         lowerCAmelCase__     :str											=				untie_r
         lowerCAmelCase__     :Optional[int]											=				init
         lowerCAmelCase__     :str											=				init_range
         lowerCAmelCase__     :Union[str, Any]											=				proj_init_std
         lowerCAmelCase__     :List[str]											=				init_std
         lowerCAmelCase__     :int											=				layer_norm_epsilon
         super().__init__(eos_token_id=__UpperCAmelCase       ,					**__UpperCAmelCase )






       @property
       def 	snake_case		(       self ):



         '''simple docstring'''

         logger.info(F"The model {self.model_type} is one of the few models that has no sequence length limit." )
         return -1






       @max_position_embeddings.setter
       def 	snake_case		(       self       ,					__UpperCAmelCase ):



         '''simple docstring'''

         raise NotImplementedError(
             F"The model {self.model_type} is one of the few models that has no sequence length limit." )







"""simple docstring"""





# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__A											=						{
    """configuration_mgp_str""": ["""MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP""", """MgpstrConfig"""],
    """processing_mgp_str""": ["""MgpstrProcessor"""],
    """tokenization_mgp_str""": ["""MgpstrTokenizer"""],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __A											=						[
      """MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """MgpstrModel""",
      """MgpstrPreTrainedModel""",
      """MgpstrForSceneTextRecognition""",
  ]

if TYPE_CHECKING:
  from .configuration_mgp_str import MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP, MgpstrConfig
  from .processing_mgp_str import MgpstrProcessor
  from .tokenization_mgp_str import MgpstrTokenizer

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_mgp_str import (
        MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST,
        MgpstrForSceneTextRecognition,
        MgpstrModel,
        MgpstrPreTrainedModel,
    )
else:
  import sys

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