


"""simple docstring"""





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


__UpperCAmelCase    				=      logging.get_logger(__name__)

__UpperCAmelCase    				=      {
    'facebook/opt-125m': 'https://huggingface.co/facebook/opt-125m/blob/main/config.json',
    'facebook/opt-350m': 'https://huggingface.co/facebook/opt-350m/blob/main/config.json',
    'facebook/opt-1.3b': 'https://huggingface.co/facebook/opt-1.3b/blob/main/config.json',
    'facebook/opt-2.7b': 'https://huggingface.co/facebook/opt-2.7b/blob/main/config.json',
    'facebook/opt-6.7b': 'https://huggingface.co/facebook/opt-6.7b/blob/main/config.json',
    'facebook/opt-13b': 'https://huggingface.co/facebook/opt-13b/blob/main/config.json',
}

class  lowercase_  ( A__						):
      __magic_name__     :							List[Any]          =				"""opt"""
      __magic_name__     :							Optional[int]          =				["""past_key_values"""]







      def __init__(      self :							List[str]		,  _lowercase :							Union[str, Any]=5_0_2_7_2		,  _lowercase :							Optional[int]=7_6_8		,  _lowercase :							int=1_2		,  _lowercase :							Optional[int]=3_0_7_2		,  _lowercase :							str=2_0_4_8		,  _lowercase :							Dict=True		,  _lowercase :							List[Any]=False		,  _lowercase :							Union[str, Any]=None		,  _lowercase :							Any=0.1		,  _lowercase :							Optional[int]=0.0		,  _lowercase :							str=1_2		,  _lowercase :							Optional[Any]="relu"		,  _lowercase :							Optional[Any]=0.0		,  _lowercase :							int=0.02		,  _lowercase :							int=True		,  _lowercase :							Optional[int]=1		,  _lowercase :							int=2		,  _lowercase :							Dict=2		,  _lowercase :							Union[str, Any]=True		,  _lowercase :							List[str]=True		,  **_lowercase :							int		,  ):
        super().__init__(
            pad_token_id=_lowerCAmelCase		,  bos_token_id=_lowerCAmelCase		,  eos_token_id=_lowerCAmelCase		,  **_lowerCAmelCase		,  )
        lowerCAmelCase__    :    Dict								=					vocab_size
        lowerCAmelCase__    :    Optional[Any]								=					max_position_embeddings
        lowerCAmelCase__    :    Any								=					num_attention_heads
        lowerCAmelCase__    :    List[Any]								=					word_embed_proj_dim if word_embed_proj_dim is not None else hidden_size
        lowerCAmelCase__    :    Dict								=					ffn_dim
        lowerCAmelCase__    :    Tuple								=					hidden_size
        lowerCAmelCase__    :    int								=					num_hidden_layers
        lowerCAmelCase__    :    int								=					dropout
        lowerCAmelCase__    :    List[str]								=					attention_dropout
        lowerCAmelCase__    :    List[str]								=					activation_function
        lowerCAmelCase__    :    Tuple								=					init_std
        lowerCAmelCase__    :    str								=					layerdrop
        lowerCAmelCase__    :    int								=					use_cache
        lowerCAmelCase__    :    List[str]								=					do_layer_norm_before
        # We keep these variables at `True` for backward compatibility.
        lowerCAmelCase__    :    Any								=					enable_bias
        lowerCAmelCase__    :    Optional[Any]								=					layer_norm_elementwise_affine

        # Note that the only purpose of `_remove_final_layer_norm` is to keep backward compatibility
        # with checkpoints that have been fine-tuned before transformers v4.20.1
        # see https://github.com/facebookresearch/metaseq/pull/164
        lowerCAmelCase__    :    str								=					_remove_final_layer_norm




"""simple docstring"""





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__UpperCAmelCase    				=      {"configuration_sew_d": ["SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP", "SEWDConfig"]}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   __UpperCAmelCase    				=      [
       "SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST",
       "SEWDForCTC",
       "SEWDForSequenceClassification",
       "SEWDModel",
       "SEWDPreTrainedModel",
   ]

if TYPE_CHECKING:
   from .configuration_sew_d import SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWDConfig

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_sew_d import (
          SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST,
          SEWDForCTC,
          SEWDForSequenceClassification,
          SEWDModel,
          SEWDPreTrainedModel,
      )


else:
   import sys

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