





'''simple docstring'''


from typing import TYPE_CHECKING

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


_SCREAMING_SNAKE_CASE	 =							{
    "configuration_deberta": ["DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP", "DebertaConfig", "DebertaOnnxConfig"],
    "tokenization_deberta": ["DebertaTokenizer"],
}

try:
       if not is_tokenizers_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       _SCREAMING_SNAKE_CASE	 =							["DebertaTokenizerFast"]

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       _SCREAMING_SNAKE_CASE	 =							[
           "DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST",
           "DebertaForMaskedLM",
           "DebertaForQuestionAnswering",
           "DebertaForSequenceClassification",
           "DebertaForTokenClassification",
           "DebertaModel",
           "DebertaPreTrainedModel",
       ]

try:
       if not is_tf_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       _SCREAMING_SNAKE_CASE	 =							[
           "TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST",
           "TFDebertaForMaskedLM",
           "TFDebertaForQuestionAnswering",
           "TFDebertaForSequenceClassification",
           "TFDebertaForTokenClassification",
           "TFDebertaModel",
           "TFDebertaPreTrainedModel",
       ]


if TYPE_CHECKING:
       from .configuration_deberta import DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, DebertaConfig, DebertaOnnxConfig
       from .tokenization_deberta import DebertaTokenizer

       try:
              if not is_tokenizers_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .tokenization_deberta_fast import DebertaTokenizerFast

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_deberta import (
                  DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
                  DebertaForMaskedLM,
                  DebertaForQuestionAnswering,
                  DebertaForSequenceClassification,
                  DebertaForTokenClassification,
                  DebertaModel,
                  DebertaPreTrainedModel,
              )

       try:
              if not is_tf_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_tf_deberta import (
                  TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
                  TFDebertaForMaskedLM,
                  TFDebertaForQuestionAnswering,
                  TFDebertaForSequenceClassification,
                  TFDebertaForTokenClassification,
                  TFDebertaModel,
                  TFDebertaPreTrainedModel,
              )


else:
       import sys

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









'''simple docstring'''


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


_SCREAMING_SNAKE_CASE	 =							logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE	 =							{
    "facebook/s2t-wav2vec2-large-en-de": (
        "https://huggingface.co/facebook/s2t-wav2vec2-large-en-de/resolve/main/config.json"
    ),
    # See all Speech2Text models at https://huggingface.co/models?filter=speech2text2
}

class    lowerCAmelCase_		(		__magic_name__		):
 __lowerCamelCase						:							str         =					"speech_to_text_2"
 __lowerCamelCase						:							Union[str, Any]         =					["past_key_values"]
 __lowerCamelCase						:							Tuple         =					{"num_attention_heads": "decoder_attention_heads", "hidden_size": "d_model"}




 def __init__(	self			,     _lowerCAmelCase=10000			,     _lowerCAmelCase=6			,     _lowerCAmelCase=2048			,     _lowerCAmelCase=4			,     _lowerCAmelCase=0.0			,     _lowerCAmelCase=True			,     _lowerCAmelCase="relu"			,     _lowerCAmelCase=256			,     _lowerCAmelCase=0.1			,     _lowerCAmelCase=0.0			,     _lowerCAmelCase=0.0			,     _lowerCAmelCase=0.02			,     _lowerCAmelCase=2			,     _lowerCAmelCase=True			,     _lowerCAmelCase=1			,     _lowerCAmelCase=0			,     _lowerCAmelCase=2			,     _lowerCAmelCase=1024			,     **_lowerCAmelCase			,     )    ->							Dict:
     _lowerCAmelCase				=      vocab_size
     _lowerCAmelCase				=      d_model
     _lowerCAmelCase				=      decoder_ffn_dim
     _lowerCAmelCase				=      decoder_layers
     _lowerCAmelCase				=      decoder_attention_heads
     _lowerCAmelCase				=      dropout
     _lowerCAmelCase				=      attention_dropout
     _lowerCAmelCase				=      activation_dropout
     _lowerCAmelCase				=      activation_function
     _lowerCAmelCase				=      init_std
     _lowerCAmelCase				=      decoder_layerdrop
     _lowerCAmelCase				=      use_cache
     _lowerCAmelCase				=      decoder_layers
     _lowerCAmelCase				=      scale_embedding  # scale factor will be sqrt(d_model) if True
     _lowerCAmelCase				=      max_target_positions

     super().__init__(
         pad_token_id=_lowerCAmelCase			,     bos_token_id=_lowerCAmelCase			,     eos_token_id=_lowerCAmelCase			,     decoder_start_token_id=_lowerCAmelCase			,     **_lowerCAmelCase			,     )


