

'''simple docstring'''







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    =  {
    'flaubert/flaubert_small_cased': 'https://huggingface.co/flaubert/flaubert_small_cased/resolve/main/config.json',
    'flaubert/flaubert_base_uncased': 'https://huggingface.co/flaubert/flaubert_base_uncased/resolve/main/config.json',
    'flaubert/flaubert_base_cased': 'https://huggingface.co/flaubert/flaubert_base_cased/resolve/main/config.json',
    'flaubert/flaubert_large_cased': 'https://huggingface.co/flaubert/flaubert_large_cased/resolve/main/config.json',
}
class 					__a   (		SCREAMING_SNAKE_CASE_  ):
						__SCREAMING_SNAKE_CASE     :					Dict  =      """flaubert"""
						__SCREAMING_SNAKE_CASE     :					Dict  =      {
						    """hidden_size""": """emb_dim""",
						    """num_attention_heads""": """n_heads""",
						    """num_hidden_layers""": """n_layers""",
						    """n_words""": """vocab_size""",  # For backward compatibility
						}

						def __init__(		self	:						Optional[Any]    ,			lowercase__	:						List[Any]=False    ,			lowercase__	:						Union[str, Any]=0.0    ,			lowercase__	:						int=3_01_45    ,			lowercase__	:						Optional[int]=20_48    ,			lowercase__	:						Union[str, Any]=12    ,			lowercase__	:						Dict=16    ,			lowercase__	:						List[Any]=0.1    ,			lowercase__	:						str=0.1    ,			lowercase__	:						Optional[int]=True    ,			lowercase__	:						Dict=False    ,			lowercase__	:						Dict=False    ,			lowercase__	:						Optional[int]=False    ,			lowercase__	:						List[Any]=1    ,			lowercase__	:						Optional[Any]=True    ,			lowercase__	:						Union[str, Any]=5_12    ,			lowercase__	:						List[Any]=20_48**-0.5    ,			lowercase__	:						int=1e-12    ,			lowercase__	:						List[str]=0.02    ,			lowercase__	:						Optional[Any]=0    ,			lowercase__	:						Tuple=1    ,			lowercase__	:						Optional[int]=2    ,			lowercase__	:						Dict=3    ,			lowercase__	:						Tuple=5    ,			lowercase__	:						Optional[Any]=True    ,			lowercase__	:						Tuple="first"    ,			lowercase__	:						Optional[int]=True    ,			lowercase__	:						Dict=None    ,			lowercase__	:						Optional[Any]=True    ,			lowercase__	:						Union[str, Any]=0.1    ,			lowercase__	:						List[str]=5    ,			lowercase__	:						Any=5    ,			lowercase__	:						Tuple=0    ,			lowercase__	:						int=0    ,			lowercase__	:						Dict=2    ,			lowercase__	:						Any=0    ,			**lowercase__	:						int    ,			)						->List[str]:

							"""simple docstring"""



							_lowercase							=     pre_norm
							_lowercase							=     layerdrop
							_lowercase							=     vocab_size
							_lowercase							=     emb_dim
							_lowercase							=     n_layers
							_lowercase							=     n_heads
							_lowercase							=     dropout
							_lowercase							=     attention_dropout
							_lowercase							=     gelu_activation
							_lowercase							=     sinusoidal_embeddings
							_lowercase							=     causal
							_lowercase							=     asm
							_lowercase							=     n_langs
							_lowercase							=     use_lang_emb
							_lowercase							=     layer_norm_eps
							_lowercase							=     bos_index
							_lowercase							=     eos_index
							_lowercase							=     pad_index
							_lowercase							=     unk_index
							_lowercase							=     mask_index
							_lowercase							=     is_encoder
							_lowercase							=     max_position_embeddings
							_lowercase							=     embed_init_std
							_lowercase							=     init_std
							_lowercase							=     summary_type
							_lowercase							=     summary_use_proj
							_lowercase							=     summary_activation
							_lowercase							=     summary_proj_to_labels
							_lowercase							=     summary_first_dropout
							_lowercase							=     start_n_top
							_lowercase							=     end_n_top
							_lowercase							=     mask_token_id
							_lowercase							=     lang_id

							if "n_words" in kwargs:
								_lowercase							=     kwargs["""n_words"""]

							super().__init__(pad_token_id=__UpperCAmelCase    ,			bos_token_id=__UpperCAmelCase    ,			**__UpperCAmelCase)






class 					__a   (		SCREAMING_SNAKE_CASE_  ):

						@property
						def 	_UpperCAmelCase							(		self	:						List[str])						->Mapping[str, Mapping[int, str]]:

							"""simple docstring"""



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






"""simple docstring"""






from typing import TYPE_CHECKING

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


UpperCamelCase_						   =   {
    'configuration_sam': [
        'SAM_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'SamConfig',
        'SamMaskDecoderConfig',
        'SamPromptEncoderConfig',
        'SamVisionConfig',
    ],
    'processing_sam': ['SamProcessor'],
}


try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      UpperCamelCase_						   =   [
          'SAM_PRETRAINED_MODEL_ARCHIVE_LIST',
          'SamModel',
          'SamPreTrainedModel',
      ]
try:
      if not is_tf_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      UpperCamelCase_						   =   [
          'TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST',
          'TFSamModel',
          'TFSamPreTrainedModel',
      ]
try:
      if not is_vision_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      UpperCamelCase_						   =   ['SamImageProcessor']


if TYPE_CHECKING:
      from .configuration_sam import (
          SAM_PRETRAINED_CONFIG_ARCHIVE_MAP,
          SamConfig,
          SamMaskDecoderConfig,
          SamPromptEncoderConfig,
          SamVisionConfig,
      )
      from .processing_sam import SamProcessor

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_sam import SAM_PRETRAINED_MODEL_ARCHIVE_LIST, SamModel, SamPreTrainedModel

      try:
            if not is_tf_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_tf_sam import TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST, TFSamModel, TFSamPreTrainedModel

      try:
            if not is_vision_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .image_processing_sam import SamImageProcessor

else:
      import sys

      UpperCamelCase_						   =   _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)