from typing import TYPE_CHECKING

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


lowerCamelCase_				:		Optional[int]       						=       {
    """configuration_openai""": ["""OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """OpenAIGPTConfig"""],
    """tokenization_openai""": ["""OpenAIGPTTokenizer"""],
}

try:
	if not is_tokenizers_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	lowerCamelCase_				:		Tuple       						=       ["""OpenAIGPTTokenizerFast"""]

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	lowerCamelCase_				:		Tuple       						=       [
	    """OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """OpenAIGPTDoubleHeadsModel""",
	    """OpenAIGPTForSequenceClassification""",
	    """OpenAIGPTLMHeadModel""",
	    """OpenAIGPTModel""",
	    """OpenAIGPTPreTrainedModel""",
	    """load_tf_weights_in_openai_gpt""",
	]

try:
	if not is_tf_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	lowerCamelCase_				:		Any       						=       [
	    """TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """TFOpenAIGPTDoubleHeadsModel""",
	    """TFOpenAIGPTForSequenceClassification""",
	    """TFOpenAIGPTLMHeadModel""",
	    """TFOpenAIGPTMainLayer""",
	    """TFOpenAIGPTModel""",
	    """TFOpenAIGPTPreTrainedModel""",
	]


if TYPE_CHECKING:
	from .configuration_openai import OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP, OpenAIGPTConfig
	from .tokenization_openai import OpenAIGPTTokenizer

	try:
		if not is_tokenizers_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_openai_fast import OpenAIGPTTokenizerFast

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_openai import (
		    OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST,
		    OpenAIGPTDoubleHeadsModel,
		    OpenAIGPTForSequenceClassification,
		    OpenAIGPTLMHeadModel,
		    OpenAIGPTModel,
		    OpenAIGPTPreTrainedModel,
		    load_tf_weights_in_openai_gpt,
		)

	try:
		if not is_tf_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_tf_openai import (
		    TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST,
		    TFOpenAIGPTDoubleHeadsModel,
		    TFOpenAIGPTForSequenceClassification,
		    TFOpenAIGPTLMHeadModel,
		    TFOpenAIGPTMainLayer,
		    TFOpenAIGPTModel,
		    TFOpenAIGPTPreTrainedModel,
		)

else:
	import sys

	lowerCamelCase_				:		Optional[int]       						=       _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)







from collections import OrderedDict
from typing import Mapping

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


lowerCamelCase_    =					logging.get_logger(__name__)

lowerCamelCase_    =					{
    '''google/rembert''': '''https://huggingface.co/google/rembert/resolve/main/config.json''',
    # See all RemBERT models at https://huggingface.co/models?filter=rembert
}







class  __lowerCamelCase				(	__snake_case	):
      lowerCamelCase_	:      Tuple          =					'rembert'







      def __init__(     self							,  lowerCamelCase=250300							,  lowerCamelCase=1152							,  lowerCamelCase=32							,  lowerCamelCase=18							,  lowerCamelCase=256							,  lowerCamelCase=1664							,  lowerCamelCase=4608							,  lowerCamelCase="gelu"							,  lowerCamelCase=0.0							,  lowerCamelCase=0.0							,  lowerCamelCase=0.1							,  lowerCamelCase=512							,  lowerCamelCase=2							,  lowerCamelCase=0.02							,  lowerCamelCase=1e-12							,  lowerCamelCase=True							,  lowerCamelCase=0							,  lowerCamelCase=312							,  lowerCamelCase=313							,  **lowerCamelCase							,  )						->       Union[str, Any]:
        super().__init__(pad_token_id=lowerCamelCase							,  bos_token_id=lowerCamelCase							,  eos_token_id=lowerCamelCase							,  **lowerCamelCase   )

        snake_case_       						=      vocab_size
        snake_case_       						=      input_embedding_size
        snake_case_       						=      output_embedding_size
        snake_case_       						=      max_position_embeddings
        snake_case_       						=      hidden_size
        snake_case_       						=      num_hidden_layers
        snake_case_       						=      num_attention_heads
        snake_case_       						=      intermediate_size
        snake_case_       						=      hidden_act
        snake_case_       						=      hidden_dropout_prob
        snake_case_       						=      attention_probs_dropout_prob
        snake_case_       						=      classifier_dropout_prob
        snake_case_       						=      initializer_range
        snake_case_       						=      type_vocab_size
        snake_case_       						=      layer_norm_eps
        snake_case_       						=      use_cache
        snake_case_       						=      False







class  __lowerCamelCase				(	__snake_case	):







      @property
      def 	lowerCAmelCase_    (     self   )						->       Mapping[str, Mapping[int, str]]:
        if self.task == "multiple-choice":
          snake_case_       						=      {0: """batch""", 1: """choice""", 2: """sequence"""}
        else:
          snake_case_       						=      {0: """batch""", 1: """sequence"""}
        return OrderedDict(
            [
                ("""input_ids""", dynamic_axis),
                ("""attention_mask""", dynamic_axis),
                ("""token_type_ids""", dynamic_axis),
            ]   )







      @property
      def 	lowerCAmelCase_    (     self   )						->       float:
        return 1e-4