




from collections import OrderedDict
from typing import Mapping

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


UpperCAmelCase_		:					str          =  logging.get_logger(__name__)

UpperCAmelCase_		:					Union[str, Any]          =  {
    '''junnyu/roformer_chinese_small''': '''https://huggingface.co/junnyu/roformer_chinese_small/resolve/main/config.json''',
    '''junnyu/roformer_chinese_base''': '''https://huggingface.co/junnyu/roformer_chinese_base/resolve/main/config.json''',
    '''junnyu/roformer_chinese_char_small''': (
        '''https://huggingface.co/junnyu/roformer_chinese_char_small/resolve/main/config.json'''
    ),
    '''junnyu/roformer_chinese_char_base''': (
        '''https://huggingface.co/junnyu/roformer_chinese_char_base/resolve/main/config.json'''
    ),
    '''junnyu/roformer_small_discriminator''': (
        '''https://huggingface.co/junnyu/roformer_small_discriminator/resolve/main/config.json'''
    ),
    '''junnyu/roformer_small_generator''': (
        '''https://huggingface.co/junnyu/roformer_small_generator/resolve/main/config.json'''
    ),
    # See all RoFormer models at https://huggingface.co/models?filter=roformer
}




class 		__A   (      snake_case_      ):
						UpperCamelCase      =       '''roformer'''

						def __init__(		self :List[str]     ,			__snake_case :Optional[int]=5_00_00     ,			__snake_case :Optional[int]=None     ,			__snake_case :Optional[int]=7_68     ,			__snake_case :List[Any]=12     ,			__snake_case :Optional[Any]=12     ,			__snake_case :Tuple=30_72     ,			__snake_case :Dict="gelu"     ,			__snake_case :int=0.1     ,			__snake_case :Optional[Any]=0.1     ,			__snake_case :List[Any]=15_36     ,			__snake_case :List[Any]=2     ,			__snake_case :Dict=0.02     ,			__snake_case :Optional[int]=1E-12     ,			__snake_case :Optional[int]=0     ,			__snake_case :Any=False     ,			__snake_case :Optional[Any]=True     ,			**__snake_case :Union[str, Any]     ,			):
										'''simple docstring'''

										super().__init__(pad_token_id=__snake_case     ,			**__snake_case			)

										__magic_name__						:						Union[str, Any]										=vocab_size
										__magic_name__						:						Tuple										=hidden_size if embedding_size is None else embedding_size
										__magic_name__						:						List[str]										=hidden_size
										__magic_name__						:						str										=num_hidden_layers
										__magic_name__						:						Union[str, Any]										=num_attention_heads
										__magic_name__						:						Union[str, Any]										=hidden_act
										__magic_name__						:						Tuple										=intermediate_size
										__magic_name__						:						Optional[Any]										=hidden_dropout_prob
										__magic_name__						:						str										=attention_probs_dropout_prob
										__magic_name__						:						Union[str, Any]										=max_position_embeddings
										__magic_name__						:						str										=type_vocab_size
										__magic_name__						:						List[str]										=initializer_range
										__magic_name__						:						Optional[int]										=layer_norm_eps
										__magic_name__						:						Optional[int]										=rotary_value
										__magic_name__						:						Union[str, Any]										=use_cache




class 		__A   (      snake_case_      ):

						@property
						def      A__    (		self :Union[str, Any]			):
										'''simple docstring'''

										if self.task == "multiple-choice":
														__magic_name__						:						Optional[Any]										={0: """batch""", 1: """choice""", 2: """sequence"""}
										else:
														__magic_name__						:						str										={0: """batch""", 1: """sequence"""}
										__magic_name__						:						str										={0: """batch""", 1: """sequence"""}
										return OrderedDict(
										    [
										        ("""input_ids""", dynamic_axis),
										        ("""attention_mask""", dynamic_axis),
										        ("""token_type_ids""", dynamic_axis),
										    ]			)











'''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__							:  int    ={
    '''configuration_xmod''': [
        '''XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''XmodConfig''',
        '''XmodOnnxConfig''',
    ],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A__							:  List[str]    =[
          '''XMOD_PRETRAINED_MODEL_ARCHIVE_LIST''',
          '''XmodForCausalLM''',
          '''XmodForMaskedLM''',
          '''XmodForMultipleChoice''',
          '''XmodForQuestionAnswering''',
          '''XmodForSequenceClassification''',
          '''XmodForTokenClassification''',
          '''XmodModel''',
          '''XmodPreTrainedModel''',
      ]

if TYPE_CHECKING:
      from .configuration_xmod import XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP, XmodConfig, XmodOnnxConfig

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_xmod import (
                XMOD_PRETRAINED_MODEL_ARCHIVE_LIST,
                XmodForCausalLM,
                XmodForMaskedLM,
                XmodForMultipleChoice,
                XmodForQuestionAnswering,
                XmodForSequenceClassification,
                XmodForTokenClassification,
                XmodModel,
                XmodPreTrainedModel,
            )

else:
      import sys

      A__							:  str    =_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






