


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


lowerCAmelCase       =							logging.get_logger(__name__)

lowerCAmelCase       =							{
    '''s-JoL/Open-Llama-V1''': '''https://huggingface.co/s-JoL/Open-Llama-V1/blob/main/config.json''',
}


class        _a							(			A__			):
							_lowercase	:			str        = '''open-llama'''

							def __init__(							self:	Tuple    ,						UpperCamelCase_:	Dict=100_000    ,						UpperCamelCase_:	Tuple=4_096    ,						UpperCamelCase_:	Optional[int]=11_008    ,						UpperCamelCase_:	int=32    ,						UpperCamelCase_:	List[Any]=32    ,						UpperCamelCase_:	List[str]="silu"    ,						UpperCamelCase_:	Optional[Any]=2_048    ,						UpperCamelCase_:	str=0.02    ,						UpperCamelCase_:	Optional[Any]=1E-6    ,						UpperCamelCase_:	Dict=True    ,						UpperCamelCase_:	Optional[int]=0    ,						UpperCamelCase_:	Tuple=1    ,						UpperCamelCase_:	List[Any]=2    ,						UpperCamelCase_:	Dict=False    ,						UpperCamelCase_:	str=True    ,						UpperCamelCase_:	Any=0.1    ,						UpperCamelCase_:	Union[str, Any]=0.1    ,						UpperCamelCase_:	Optional[Any]=True    ,						UpperCamelCase_:	Dict=True    ,						UpperCamelCase_:	Any=None    ,						**UpperCamelCase_:	int    ,						)			->   Tuple:





									"""simple docstring"""







									lowercase__            =      vocab_size
									lowercase__            =      max_position_embeddings
									lowercase__            =      hidden_size
									lowercase__            =      intermediate_size
									lowercase__            =      num_hidden_layers
									lowercase__            =      num_attention_heads
									lowercase__            =      hidden_act
									lowercase__            =      initializer_range
									lowercase__            =      rms_norm_eps
									lowercase__            =      use_cache
									lowercase__            =      kwargs.pop(
									    '''use_memorry_efficient_attention'''    ,						UpperCamelCase_							)
									lowercase__            =      hidden_dropout_prob
									lowercase__            =      attention_dropout_prob
									lowercase__            =      use_stable_embedding
									lowercase__            =      shared_input_output_embedding
									lowercase__            =      rope_scaling
									self._rope_scaling_validation()

									super().__init__(
									    pad_token_id=UpperCamelCase_    ,						bos_token_id=UpperCamelCase_    ,						eos_token_id=UpperCamelCase_    ,						tie_word_embeddings=UpperCamelCase_    ,						**UpperCamelCase_    ,						)


							def       lowerCamelCase_ (							self:	List[str]							)			->   Union[str, Any]:





									"""simple docstring"""







									if self.rope_scaling is None:
											return

									if not isinstance(self.rope_scaling    ,						UpperCamelCase_							) or len(self.rope_scaling							) != 2:
											raise ValueError(
											    '''`rope_scaling` must be a dictionary with with two fields, `name` and `factor`, '''
											    f'got {self.rope_scaling}'							)
									lowercase__            =      self.rope_scaling.get('''type'''    ,						UpperCamelCase_							)
									lowercase__            =      self.rope_scaling.get('''factor'''    ,						UpperCamelCase_							)
									if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic"]:
											raise ValueError(
											    f'`rope_scaling`\'s name field must be one of [\'linear\', \'dynamic\'], got {rope_scaling_type}'							)
									if rope_scaling_factor is None or not isinstance(UpperCamelCase_    ,						UpperCamelCase_							) or rope_scaling_factor <= 1.0:
											raise ValueError(f'`rope_scaling`\'s factor field must be an float > 1, got {rope_scaling_factor}'							)










from typing import TYPE_CHECKING

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


lowerCamelCase	:							int				={
    '''configuration_audio_spectrogram_transformer''': [
        '''AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''ASTConfig''',
    ]
}

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

try:
 if not is_speech_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCamelCase	:							Optional[int]				=['''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

 lowerCamelCase	:							Optional[int]				=_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)