






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


UpperCAmelCase__      			=						logging.get_logger(__name__)

UpperCAmelCase__      			=						{
    'MIT/ast-finetuned-audioset-10-10-0.4593': (
        'https://huggingface.co/MIT/ast-finetuned-audioset-10-10-0.4593/resolve/main/config.json'
    ),
}




class 							snake_case_       (    lowerCamelCase__      ):

						"""simple docstring"""



						snake_case__        =      """audio-spectrogram-transformer"""



						def __init__(self:					List[Any] ,					__UpperCAmelCase:					Optional[int]=768 ,					__UpperCAmelCase:					List[Any]=12 ,					__UpperCAmelCase:					Any=12 ,					__UpperCAmelCase:					Dict=3072 ,					__UpperCAmelCase:					Optional[int]="gelu" ,					__UpperCAmelCase:					Any=0.0 ,					__UpperCAmelCase:					Optional[Any]=0.0 ,					__UpperCAmelCase:					Optional[int]=0.02 ,					__UpperCAmelCase:					str=1E-12 ,					__UpperCAmelCase:					int=16 ,					__UpperCAmelCase:					Optional[int]=True ,					__UpperCAmelCase:					Tuple=10 ,					__UpperCAmelCase:					str=10 ,					__UpperCAmelCase:					Optional[int]=1024 ,					__UpperCAmelCase:					Dict=128 ,					**__UpperCAmelCase:					Optional[int] ,					)    ->     Optional[int]:




											'''simple docstring'''



											super().__init__(**__snake_case   )

											__a					:						List[Any]      =					hidden_size
											__a					:						List[Any]      =					num_hidden_layers
											__a					:						List[Any]      =					num_attention_heads
											__a					:						List[Any]      =					intermediate_size
											__a					:						Any      =					hidden_act
											__a					:						Any      =					hidden_dropout_prob
											__a					:						Tuple      =					attention_probs_dropout_prob
											__a					:						Union[str, Any]      =					initializer_range
											__a					:						List[str]      =					layer_norm_eps
											__a					:						Tuple      =					patch_size
											__a					:						Optional[Any]      =					qkv_bias
											__a					:						str      =					frequency_stride
											__a					:						Optional[Any]      =					time_stride
											__a					:						Union[str, Any]      =					max_length
											__a					:						int      =					num_mel_bins










'''simple docstring'''






from typing import List, Optional, Union

from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding, PaddingStrategy, PreTokenizedInput, TextInput, TruncationStrategy
from ...utils import TensorType

class 				a__(   lowerCamelCase__      ):
    lowercase__					=       ["""image_processor""", """tokenizer"""]
    lowercase__					=       """BridgeTowerImageProcessor"""
    lowercase__					=       ("""RobertaTokenizer""", """RobertaTokenizerFast""")







    def __init__( self					:    int		,     __snake_case					:    str		,     __snake_case					:    List[str]      ):
      super().__init__(__snake_case		,     __snake_case      )







    def __call__( self					:    int		,     __snake_case					:    Optional[Any]		,     __snake_case					:    Union[TextInput, PreTokenizedInput, List[TextInput], List[PreTokenizedInput]] = None		,     __snake_case					:    bool = True		,     __snake_case					:    Union[bool, str, PaddingStrategy] = False		,     __snake_case					:    Union[bool, str, TruncationStrategy] = None		,     __snake_case					:    Optional[int] = None		,     __snake_case					:    int = 0		,     __snake_case					:    Optional[int] = None		,     __snake_case					:    Optional[bool] = None		,     __snake_case					:    Optional[bool] = None		,     __snake_case					:    bool = False		,     __snake_case					:    bool = False		,     __snake_case					:    bool = False		,     __snake_case					:    bool = False		,     __snake_case					:    bool = True		,     __snake_case					:    Optional[Union[str, TensorType]] = None		,     **__snake_case					:    List[Any]		,     ):
      a		:   Optional[int]	  =	self.tokenizer(
          text=__snake_case		,     add_special_tokens=__snake_case		,     padding=__snake_case		,     truncation=__snake_case		,     max_length=__snake_case		,     stride=__snake_case		,     pad_to_multiple_of=__snake_case		,     return_token_type_ids=__snake_case		,     return_attention_mask=__snake_case		,     return_overflowing_tokens=__snake_case		,     return_special_tokens_mask=__snake_case		,     return_offsets_mapping=__snake_case		,     return_length=__snake_case		,     verbose=__snake_case		,     return_tensors=__snake_case		,     **__snake_case		,     )
      # add pixel_values + pixel_mask
      a		:   List[str]	  =	self.image_processor(
          __snake_case		,     return_tensors=__snake_case		,     do_normalize=__snake_case		,     do_center_crop=__snake_case		,     **__snake_case      )
      encoding.update(__snake_case      )

      return encoding







    def      lowercase_			( self					:    int		,     *__snake_case					:    List[str]		,     **__snake_case					:    List[str]      ):
      return self.tokenizer.batch_decode(*__snake_case		,     **__snake_case      )







    def      lowercase_			( self					:    List[str]		,     *__snake_case					:    Tuple		,     **__snake_case					:    Union[str, Any]      ):
      return self.tokenizer.decode(*__snake_case		,     **__snake_case      )







    @property
    def      lowercase_			( self					:    Optional[Any]      ):
      a		:   Optional[Any]	  =	self.tokenizer.model_input_names
      a		:   Union[str, Any]	  =	self.image_processor.model_input_names
      return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names      )      )