



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 				lowerCAmelCase_		(  a__							):
       UpperCAmelCase__				:					List[str]        =  "audio-spectrogram-transformer"
       def __init__(			self,			SCREAMING_SNAKE_CASE_=768,			SCREAMING_SNAKE_CASE_=12,			SCREAMING_SNAKE_CASE_=12,			SCREAMING_SNAKE_CASE_=3072,			SCREAMING_SNAKE_CASE_="gelu",			SCREAMING_SNAKE_CASE_=0.0,			SCREAMING_SNAKE_CASE_=0.0,			SCREAMING_SNAKE_CASE_=0.02,			SCREAMING_SNAKE_CASE_=1e-12,			SCREAMING_SNAKE_CASE_=16,			SCREAMING_SNAKE_CASE_=True,			SCREAMING_SNAKE_CASE_=10,			SCREAMING_SNAKE_CASE_=10,			SCREAMING_SNAKE_CASE_=1024,			SCREAMING_SNAKE_CASE_=128,			**SCREAMING_SNAKE_CASE_,			)     ->		Dict:
          super().__init__(**SCREAMING_SNAKE_CASE_       )

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








from typing import Optional

import pyspark

from .. import Features, NamedSplit
from ..download import DownloadMode
from ..packaged_modules.spark.spark import Spark
from .abc import AbstractDatasetReader



class 				lowerCAmelCase_		(  a__							):
       def __init__(			self,			SCREAMING_SNAKE_CASE_,			SCREAMING_SNAKE_CASE_ = None,			SCREAMING_SNAKE_CASE_ = None,			SCREAMING_SNAKE_CASE_ = True,			SCREAMING_SNAKE_CASE_ = None,			SCREAMING_SNAKE_CASE_ = False,			SCREAMING_SNAKE_CASE_ = None,			SCREAMING_SNAKE_CASE_ = True,			SCREAMING_SNAKE_CASE_ = "arrow",			**SCREAMING_SNAKE_CASE_,			)     ->		Optional[int]:
          super().__init__(
              split=SCREAMING_SNAKE_CASE_,			features=SCREAMING_SNAKE_CASE_,			cache_dir=SCREAMING_SNAKE_CASE_,			keep_in_memory=SCREAMING_SNAKE_CASE_,			streaming=SCREAMING_SNAKE_CASE_,			**SCREAMING_SNAKE_CASE_,			)
          UpperCamelCase    :  List[str]							=	load_from_cache_file
          UpperCamelCase    :  List[str]							=	file_format
          UpperCamelCase    :  Optional[int]							=	Spark(
              df=SCREAMING_SNAKE_CASE_,			features=SCREAMING_SNAKE_CASE_,			cache_dir=SCREAMING_SNAKE_CASE_,			working_dir=SCREAMING_SNAKE_CASE_,			**SCREAMING_SNAKE_CASE_,			)






       def 					snake_case_       (			self       )     ->		int:
          if self.streaming:
             return self.builder.as_streaming_dataset(split=self.split       )
          UpperCamelCase    :  Union[str, Any]							=	None if self._load_from_cache_file else DownloadMode.FORCE_REDOWNLOAD
          self.builder.download_and_prepare(
              download_mode=SCREAMING_SNAKE_CASE_,			file_format=self._file_format,			)
          return self.builder.as_dataset(split=self.split       )



