


import math

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


__UpperCamelCase				:  Any      					=							logging.get_logger(__name__)

__UpperCamelCase				:  str      					=							{
    "facebook/data2vec-base-960h": "https://huggingface.co/facebook/data2vec-audio-base-960h/resolve/main/config.json",
    # See all Data2VecAudio models at https://huggingface.co/models?filter=data2vec-audio
}





class  lowerCAmelCase__(    UpperCamelCase_						):






    '''simple docstring'''





    A_  :     Union[str, Any]			= """data2vec-audio"""





    def __init__(	self				:   str       ,   __snake_case				:   Optional[int]=32       ,   __snake_case				:   Tuple=768       ,   __snake_case				:   Optional[int]=12       ,   __snake_case				:   Dict=12       ,   __snake_case				:   List[Any]=3_072       ,   __snake_case				:   List[str]="gelu"       ,   __snake_case				:   Optional[int]=0.1       ,   __snake_case				:   Dict=0.1       ,   __snake_case				:   str=0.1       ,   __snake_case				:   List[str]=0.0       ,   __snake_case				:   int=0.1       ,   __snake_case				:   Optional[Any]=0.1       ,   __snake_case				:   Optional[Any]=0.02       ,   __snake_case				:   int=1E-5       ,   __snake_case				:   List[Any]="gelu"       ,   __snake_case				:   Union[str, Any]=(512, 512, 512, 512, 512, 512, 512)       ,   __snake_case				:   Optional[int]=(5, 2, 2, 2, 2, 2, 2)       ,   __snake_case				:   Optional[Any]=(10, 3, 3, 3, 3, 2, 2)       ,   __snake_case				:   Tuple=False       ,   __snake_case				:   Any=16       ,   __snake_case				:   Optional[int]=19       ,   __snake_case				:   Optional[int]=5       ,   __snake_case				:   List[str]=0.05       ,   __snake_case				:   Union[str, Any]=10       ,   __snake_case				:   Union[str, Any]=2       ,   __snake_case				:   List[str]=0.0       ,   __snake_case				:   Union[str, Any]=10       ,   __snake_case				:   List[Any]=0       ,   __snake_case				:   Tuple="sum"       ,   __snake_case				:   str=False       ,   __snake_case				:   Any=False       ,   __snake_case				:   List[str]=256       ,   __snake_case				:   List[Any]=(512, 512, 512, 512, 1_500)       ,   __snake_case				:   Optional[int]=(5, 3, 3, 1, 1)       ,   __snake_case				:   Dict=(1, 2, 3, 1, 1)       ,   __snake_case				:   Tuple=512       ,   __snake_case				:   Tuple=0       ,   __snake_case				:   Any=1       ,   __snake_case				:   Union[str, Any]=2       ,   __snake_case				:   Optional[int]=False       ,   __snake_case				:   Union[str, Any]=3       ,   __snake_case				:   Tuple=2       ,   __snake_case				:   Optional[Any]=3       ,   __snake_case				:   Tuple=None       ,   **__snake_case				:   Union[str, Any]       ,   ):





       '''simple docstring'''
       super().__init__(**_a       ,   pad_token_id=_a       ,   bos_token_id=_a       ,   eos_token_id=_a	)
       UpperCAmelCase_							:      int						=   hidden_size
       UpperCAmelCase_							:      Any						=   feat_extract_activation
       UpperCAmelCase_							:      Dict						=   list(_a	)
       UpperCAmelCase_							:      int						=   list(_a	)
       UpperCAmelCase_							:      str						=   list(_a	)
       UpperCAmelCase_							:      str						=   conv_bias
       UpperCAmelCase_							:      Optional[int]						=   num_conv_pos_embeddings
       UpperCAmelCase_							:      List[str]						=   num_conv_pos_embedding_groups
       UpperCAmelCase_							:      List[str]						=   conv_pos_kernel_size
       UpperCAmelCase_							:      Tuple						=   len(self.conv_dim	)
       UpperCAmelCase_							:      List[Any]						=   num_hidden_layers
       UpperCAmelCase_							:      int						=   intermediate_size
       UpperCAmelCase_							:      List[str]						=   hidden_act
       UpperCAmelCase_							:      Dict						=   num_attention_heads
       UpperCAmelCase_							:      Tuple						=   hidden_dropout
       UpperCAmelCase_							:      Optional[Any]						=   attention_dropout
       UpperCAmelCase_							:      Union[str, Any]						=   activation_dropout
       UpperCAmelCase_							:      int						=   feat_proj_dropout
       UpperCAmelCase_							:      List[Any]						=   final_dropout
       UpperCAmelCase_							:      Tuple						=   layerdrop
       UpperCAmelCase_							:      Optional[int]						=   layer_norm_eps
       UpperCAmelCase_							:      Optional[Any]						=   initializer_range
       UpperCAmelCase_							:      Union[str, Any]						=   vocab_size
       UpperCAmelCase_							:      Tuple						=   use_weighted_layer_sum

       if (
           (len(self.conv_stride	) != self.num_feat_extract_layers)
           or (len(self.conv_kernel	) != self.num_feat_extract_layers)
           or (len(self.conv_dim	) != self.num_feat_extract_layers)
       ):
          raise ValueError(
              '''Configuration for convolutional layers is incorrect. It is required that `len(config.conv_dim)` =='''
              ''' `len(config.conv_stride)` == `len(config.conv_kernel)`, but is `len(config.conv_dim) ='''
              f''' {len(self.conv_dim	)}`, `len(config.conv_stride) = {len(self.conv_stride	)}`,'''
              f''' `len(config.conv_kernel) = {len(self.conv_kernel	)}`.'''	)

       # fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
       UpperCAmelCase_							:      int						=   mask_time_prob
       UpperCAmelCase_							:      Any						=   mask_time_length
       UpperCAmelCase_							:      List[str]						=   mask_time_min_masks
       UpperCAmelCase_							:      List[Any]						=   mask_feature_prob
       UpperCAmelCase_							:      Tuple						=   mask_feature_length
       UpperCAmelCase_							:      Union[str, Any]						=   mask_feature_min_masks

       # ctc loss
       UpperCAmelCase_							:      Dict						=   ctc_loss_reduction
       UpperCAmelCase_							:      List[Any]						=   ctc_zero_infinity

       # adapter
       UpperCAmelCase_							:      int						=   add_adapter
       UpperCAmelCase_							:      List[str]						=   adapter_kernel_size
       UpperCAmelCase_							:      List[Any]						=   adapter_stride
       UpperCAmelCase_							:      Union[str, Any]						=   num_adapter_layers
       UpperCAmelCase_							:      Dict						=   output_hidden_size or hidden_size

       # SequenceClassification-specific parameter. Feel free to ignore for other classes.
       UpperCAmelCase_							:      List[Any]						=   classifier_proj_size

       # XVector-specific parameters. Feel free to ignore for other classes.
       UpperCAmelCase_							:      Tuple						=   list(_a	)
       UpperCAmelCase_							:      Optional[Any]						=   list(_a	)
       UpperCAmelCase_							:      Optional[Any]						=   list(_a	)
       UpperCAmelCase_							:      Dict						=   xvector_output_dim





    @property
    def 					_lowerCamelCase (	self				:   List[str]	):





       '''simple docstring'''
       return math.prod(self.conv_stride	)



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


__UpperCamelCase				:  str      					=							logging.get_logger(__name__)

__UpperCamelCase				:  Any      					=							{
    'tiiuae/falcon-40b': 'https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json',
    'tiiuae/falcon-7b': 'https://huggingface.co/tiiuae/falcon-7b/resolve/main/config.json',
}





class  lowerCAmelCase__(    snake_case__						):






    '''simple docstring'''





    A_  :     int			= 'falcon'
    A_  :     int			= ['past_key_values']





    def __init__(	self				:   Optional[Any]       ,   __snake_case				:   Tuple=65_024       ,   __snake_case				:   List[str]=4_544       ,   __snake_case				:   Optional[Any]=32       ,   __snake_case				:   Any=71       ,   __snake_case				:   str=1E-5       ,   __snake_case				:   List[str]=0.02       ,   __snake_case				:   List[Any]=True       ,   __snake_case				:   Dict=0.0       ,   __snake_case				:   Optional[Any]=0.0       ,   __snake_case				:   Any=None       ,   __snake_case				:   List[Any]=False       ,   __snake_case				:   Dict=False       ,   __snake_case				:   Optional[int]=True       ,   __snake_case				:   List[Any]=True       ,   __snake_case				:   Optional[Any]=False       ,   __snake_case				:   Dict=11       ,   __snake_case				:   List[str]=11       ,   **__snake_case				:   int       ,   ):





       '''simple docstring'''
       UpperCAmelCase_							:      int						=   vocab_size
       # Backward compatibility with n_embed kwarg
       UpperCAmelCase_							:      Union[str, Any]						=   kwargs.pop('''n_embed'''       ,   __snake_case	)
       UpperCAmelCase_							:      str						=   hidden_size if n_embed is None else n_embed
       UpperCAmelCase_							:      Tuple						=   num_hidden_layers
       UpperCAmelCase_							:      Tuple						=   num_attention_heads
       UpperCAmelCase_							:      Optional[int]						=   layer_norm_epsilon
       UpperCAmelCase_							:      int						=   initializer_range
       UpperCAmelCase_							:      Optional[int]						=   use_cache
       UpperCAmelCase_							:      List[Any]						=   hidden_dropout
       UpperCAmelCase_							:      Any						=   attention_dropout

       UpperCAmelCase_							:      Tuple						=   bos_token_id
       UpperCAmelCase_							:      List[Any]						=   eos_token_id
       UpperCAmelCase_							:      Any						=   num_attention_heads if num_kv_heads is None else num_kv_heads
       UpperCAmelCase_							:      Optional[int]						=   alibi
       UpperCAmelCase_							:      Dict						=   new_decoder_architecture
       UpperCAmelCase_							:      List[Any]						=   multi_query  # Ignored when new_decoder_architecture is True
       UpperCAmelCase_							:      Tuple						=   parallel_attn
       UpperCAmelCase_							:      List[Any]						=   bias

       super().__init__(bos_token_id=__snake_case       ,   eos_token_id=__snake_case       ,   **__snake_case	)





    @property
    def 					_lowerCamelCase (	self				:   Optional[int]	):





       '''simple docstring'''
       return self.hidden_size // self.num_attention_heads





    @property
    def 					_lowerCamelCase (	self				:   Optional[int]	):





       '''simple docstring'''
       return not self.alibi