






from typing import TYPE_CHECKING

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


_a      	=  {'''configuration_mbart''': ['''MBART_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''MBartConfig''', '''MBartOnnxConfig''']}

try:
		if not is_sentencepiece_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_a      	=  ['''MBartTokenizer''']

try:
		if not is_tokenizers_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_a      	=  ['''MBartTokenizerFast''']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_a      	=  [
		    '''MBART_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''MBartForCausalLM''',
		    '''MBartForConditionalGeneration''',
		    '''MBartForQuestionAnswering''',
		    '''MBartForSequenceClassification''',
		    '''MBartModel''',
		    '''MBartPreTrainedModel''',
		]

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_a      	=  [
		    '''TFMBartForConditionalGeneration''',
		    '''TFMBartModel''',
		    '''TFMBartPreTrainedModel''',
		]

try:
		if not is_flax_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_a      	=  [
		    '''FlaxMBartForConditionalGeneration''',
		    '''FlaxMBartForQuestionAnswering''',
		    '''FlaxMBartForSequenceClassification''',
		    '''FlaxMBartModel''',
		    '''FlaxMBartPreTrainedModel''',
		]


if TYPE_CHECKING:
		from .configuration_mbart import MBART_PRETRAINED_CONFIG_ARCHIVE_MAP, MBartConfig, MBartOnnxConfig

		try:
				if not is_sentencepiece_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_mbart import MBartTokenizer

		try:
				if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_mbart_fast import MBartTokenizerFast

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_mbart import (
				    MBART_PRETRAINED_MODEL_ARCHIVE_LIST,
				    MBartForCausalLM,
				    MBartForConditionalGeneration,
				    MBartForQuestionAnswering,
				    MBartForSequenceClassification,
				    MBartModel,
				    MBartPreTrainedModel,
				)

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_mbart import TFMBartForConditionalGeneration, TFMBartModel, TFMBartPreTrainedModel

		try:
				if not is_flax_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_flax_mbart import (
				    FlaxMBartForConditionalGeneration,
				    FlaxMBartForQuestionAnswering,
				    FlaxMBartForSequenceClassification,
				    FlaxMBartModel,
				    FlaxMBartPreTrainedModel,
				)

else:
		import sys

		_a      	=  _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


_a      	=  logging.get_logger(__name__)

_a      	=  {
    '''distilbert-base-uncased''': '''https://huggingface.co/distilbert-base-uncased/resolve/main/config.json''',
    '''distilbert-base-uncased-distilled-squad''': (
        '''https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/config.json'''
    ),
    '''distilbert-base-cased''': '''https://huggingface.co/distilbert-base-cased/resolve/main/config.json''',
    '''distilbert-base-cased-distilled-squad''': (
        '''https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/config.json'''
    ),
    '''distilbert-base-german-cased''': '''https://huggingface.co/distilbert-base-german-cased/resolve/main/config.json''',
    '''distilbert-base-multilingual-cased''': (
        '''https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/config.json'''
    ),
    '''distilbert-base-uncased-finetuned-sst-2-english''': (
        '''https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english/resolve/main/config.json'''
    ),
}





class __lowerCamelCase (      snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=      "distilbert"
	UpperCamelCase__								=      {
	    "hidden_size": "dim",
	    "num_attention_heads": "n_heads",
	    "num_hidden_layers": "n_layers",
	}

	def __init__(							self       ,    UpperCAmelCase=3_0522       ,    UpperCAmelCase=512       ,    UpperCAmelCase=False       ,    UpperCAmelCase=6       ,    UpperCAmelCase=12       ,    UpperCAmelCase=768       ,    UpperCAmelCase=4 * 768       ,    UpperCAmelCase=0.1       ,    UpperCAmelCase=0.1       ,    UpperCAmelCase="gelu"       ,    UpperCAmelCase=0.02       ,    UpperCAmelCase=0.1       ,    UpperCAmelCase=0.2       ,    UpperCAmelCase=0       ,    **UpperCAmelCase       ,    ):
							"""simple docstring"""







							_UpperCAmelCase									=			vocab_size
							_UpperCAmelCase									=			max_position_embeddings
							_UpperCAmelCase									=			sinusoidal_pos_embds
							_UpperCAmelCase									=			n_layers
							_UpperCAmelCase									=			n_heads
							_UpperCAmelCase									=			dim
							_UpperCAmelCase									=			hidden_dim
							_UpperCAmelCase									=			dropout
							_UpperCAmelCase									=			attention_dropout
							_UpperCAmelCase									=			activation
							_UpperCAmelCase									=			initializer_range
							_UpperCAmelCase									=			qa_dropout
							_UpperCAmelCase									=			seq_classif_dropout
							super().__init__(**UpperCAmelCase       ,    pad_token_id=UpperCAmelCase    )





class __lowerCamelCase (      snake_case__):





	"""simple docstring"""






	@property
	def        UpperCamelCase    (							self    ):
							"""simple docstring"""







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