

from dataclasses import asdict, dataclass
from typing import Optional

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


A											=     logging.get_logger(__name__)

# TODO Update this
A											=     {
    'facebook/esm-1b': 'https://huggingface.co/facebook/esm-1b/resolve/main/config.json',
    # See all ESM models at https://huggingface.co/models?filter=esm
}


class SCREAMING_SNAKE_CASE  (		__snake_case							):






			"""simple docstring"""




			__A						  =  """esm"""


			def __init__(    self ,				__UpperCamelCase=None ,				__UpperCamelCase=None ,				__UpperCamelCase=None ,				__UpperCamelCase=7_68 ,				__UpperCamelCase=12 ,				__UpperCamelCase=12 ,				__UpperCamelCase=30_72 ,				__UpperCamelCase=0.1 ,				__UpperCamelCase=0.1 ,				__UpperCamelCase=10_26 ,				__UpperCamelCase=0.02 ,				__UpperCamelCase=1E-12 ,				__UpperCamelCase="absolute" ,				__UpperCamelCase=True ,				__UpperCamelCase=None ,				__UpperCamelCase=False ,				__UpperCamelCase=False ,				__UpperCamelCase=None ,				__UpperCamelCase=None ,				**__UpperCamelCase ,				):

				"""simple docstring"""


				super().__init__(pad_token_id=__UpperCamelCase ,				mask_token_id=__UpperCamelCase ,				**__UpperCamelCase							)

				snake_case_      		= vocab_size
				snake_case_      		= hidden_size
				snake_case_      		= num_hidden_layers
				snake_case_      		= num_attention_heads
				snake_case_      		= intermediate_size
				snake_case_      		= hidden_dropout_prob
				snake_case_      		= attention_probs_dropout_prob
				snake_case_      		= max_position_embeddings
				snake_case_      		= initializer_range
				snake_case_      		= layer_norm_eps
				snake_case_      		= position_embedding_type
				snake_case_      		= use_cache
				snake_case_      		= emb_layer_norm_before
				snake_case_      		= token_dropout
				snake_case_      		= is_folding_model
				if is_folding_model:
					if esmfold_config is None:
						logger.info('No esmfold_config supplied for folding model, using default values.'							)
						snake_case_      		= EsmFoldConfig()
					elif isinstance(__UpperCamelCase ,				__UpperCamelCase							):
						snake_case_      		= EsmFoldConfig(**__UpperCamelCase							)
					snake_case_      		= esmfold_config
					if vocab_list is None:
						logger.warning('No vocab_list supplied for folding model, assuming the ESM-2 vocabulary!'							)
						snake_case_      		= get_default_vocab_list()
					else:
						snake_case_      		= vocab_list
				else:
					snake_case_      		= None
					snake_case_      		= None
				if self.esmfold_config is not None and getattr(self.esmfold_config ,				'use_esm_attn_map' ,				__UpperCamelCase							):
					raise ValueError('The HuggingFace port of ESMFold does not support use_esm_attn_map at this time!'							)







			def 			__lowerCAmelCase (    self							):

				"""simple docstring"""


				snake_case_      		= super().to_dict()
				if isinstance(self.esmfold_config ,				__UpperCamelCase							):
					snake_case_      		= self.esmfold_config.to_dict()
				return output







@dataclass
class SCREAMING_SNAKE_CASE  :






			"""simple docstring"""




			__A						  =  None
			__A						  =  True
			__A						  =  False
			__A						  =  False
			__A						  =  False
			__A						  =  0

			__A						  =  True
			__A						  =  False

			__A						  =  1_2_8
			__A						  =  None


			def 			__lowerCAmelCase (    self							):

				"""simple docstring"""


				if self.trunk is None:
					snake_case_      		= TrunkConfig()
				elif isinstance(self.trunk ,				__UpperCamelCase							):
					snake_case_      		= TrunkConfig(**self.trunk							)







			def 			__lowerCAmelCase (    self							):

				"""simple docstring"""


				snake_case_      		= asdict(self							)
				snake_case_      		= self.trunk.to_dict()
				return output







@dataclass
class SCREAMING_SNAKE_CASE  :






			"""simple docstring"""




			__A						  =  4_8
			__A						  =  1_0_2_4
			__A						  =  1_2_8
			__A						  =  3_2
			__A						  =  3_2
			__A						  =  3_2
			__A						  =  0
			__A						  =  0
			__A						  =  False
			__A						  =  4
			__A						  =  1_2_8
			__A						  =  None


			def 			__lowerCAmelCase (    self							):

				"""simple docstring"""


				if self.structure_module is None:
					snake_case_      		= StructureModuleConfig()
				elif isinstance(self.structure_module ,				__UpperCamelCase							):
					snake_case_      		= StructureModuleConfig(**self.structure_module							)

				if self.max_recycles <= 0:
					raise ValueError(f"""`max_recycles` should be positive, got {self.max_recycles}."""							)
				if self.sequence_state_dim % self.sequence_state_dim != 0:
					raise ValueError(
					    '`sequence_state_dim` should be a round multiple of `sequence_state_dim`, got'
					    f""" {self.sequence_state_dim} and {self.sequence_state_dim}."""							)
				if self.pairwise_state_dim % self.pairwise_state_dim != 0:
					raise ValueError(
					    '`pairwise_state_dim` should be a round multiple of `pairwise_state_dim`, got'
					    f""" {self.pairwise_state_dim} and {self.pairwise_state_dim}."""							)

				snake_case_      		= self.sequence_state_dim // self.sequence_head_width
				snake_case_      		= self.pairwise_state_dim // self.pairwise_head_width

				if self.sequence_state_dim != sequence_num_heads * self.sequence_head_width:
					raise ValueError(
					    '`sequence_state_dim` should be equal to `sequence_num_heads * sequence_head_width, got'
					    f""" {self.sequence_state_dim} != {sequence_num_heads} * {self.sequence_head_width}."""							)
				if self.pairwise_state_dim != pairwise_num_heads * self.pairwise_head_width:
					raise ValueError(
					    '`pairwise_state_dim` should be equal to `pairwise_num_heads * pairwise_head_width, got'
					    f""" {self.pairwise_state_dim} != {pairwise_num_heads} * {self.pairwise_head_width}."""							)
				if self.pairwise_state_dim % 2 != 0:
					raise ValueError(f"""`pairwise_state_dim` should be even, got {self.pairwise_state_dim}."""							)

				if self.dropout >= 0.4:
					raise ValueError(f"""`dropout` should not be greater than 0.4, got {self.dropout}."""							)







			def 			__lowerCAmelCase (    self							):

				"""simple docstring"""


				snake_case_      		= asdict(self							)
				snake_case_      		= self.structure_module.to_dict()
				return output







@dataclass
class SCREAMING_SNAKE_CASE  :






			"""simple docstring"""




			__A						  =  3_8_4
			__A						  =  1_2_8
			__A						  =  1_6
			__A						  =  1_2_8
			__A						  =  1_2
			__A						  =  4
			__A						  =  8
			__A						  =  0.1
			__A						  =  8
			__A						  =  1
			__A						  =  2
			__A						  =  7
			__A						  =  1_0
			__A						  =  1E-8
			__A						  =  1E5


			def 			__lowerCAmelCase (    self							):

				"""simple docstring"""


				return asdict(self							)







def a():





	'''simple docstring'''
	return (
	    "<cls>",
	    "<pad>",
	    "<eos>",
	    "<unk>",
	    "L",
	    "A",
	    "G",
	    "V",
	    "S",
	    "E",
	    "R",
	    "T",
	    "I",
	    "D",
	    "P",
	    "K",
	    "Q",
	    "N",
	    "F",
	    "Y",
	    "M",
	    "H",
	    "W",
	    "C",
	    "X",
	    "B",
	    "U",
	    "Z",
	    "O",
	    ".",
	    "-",
	    "<null_1>",
	    "<mask>",
	)



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_speech_available, is_torch_available


A											=     {
    'configuration_audio_spectrogram_transformer': [
        'AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'ASTConfig',
    ]
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A											=     [
		    'AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'ASTForAudioClassification',
		    'ASTModel',
		    'ASTPreTrainedModel',
		]

try:
		if not is_speech_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A											=     ['ASTFeatureExtractor']

if TYPE_CHECKING:
		from .configuration_audio_spectrogram_transformer import (
		    AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    ASTConfig,
		)

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_audio_spectrogram_transformer import (
				    AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    ASTForAudioClassification,
				    ASTModel,
				    ASTPreTrainedModel,
				)

		try:
				if not is_speech_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .feature_extraction_audio_spectrogram_transformer import ASTFeatureExtractor


else:
		import sys

		A											=     _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
