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


SCREAMING_SNAKE_CASE							:Optional[Any]										=    logging.get_logger(__name__)

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





class 							UpperCAmelCase				(  __SCREAMING_SNAKE_CASE  ):




	'''simple docstring'''





	snake_case_    =					"open-llama"






	def __init__(	self :			Optional[Any]							,A :			Tuple=10_00_00							,A :			List[Any]=40_96							,A :			str=1_10_08							,A :			List[str]=32							,A :			Union[str, Any]=32							,A :			str="silu"							,A :			str=20_48							,A :			str=0.02							,A :			str=1E-6							,A :			Any=True							,A :			List[str]=0							,A :			List[str]=1							,A :			Any=2							,A :			Optional[Any]=False							,A :			Optional[int]=True							,A :			str=0.1							,A :			List[str]=0.1							,A :			Dict=True							,A :			Dict=True							,A :			Optional[Any]=None							,**A :			List[Any]							,):
					__A             =			vocab_size
					__A             =			max_position_embeddings
					__A             =			hidden_size
					__A             =			intermediate_size
					__A             =			num_hidden_layers
					__A             =			num_attention_heads
					__A             =			hidden_act
					__A             =			initializer_range
					__A             =			rms_norm_eps
					__A             =			use_cache
					__A             =			kwargs.pop(
					    "use_memorry_efficient_attention"							,A			)
					__A             =			hidden_dropout_prob
					__A             =			attention_dropout_prob
					__A             =			use_stable_embedding
					__A             =			shared_input_output_embedding
					__A             =			rope_scaling
					self._rope_scaling_validation()

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







	def     UpperCamelCase_  (	self :			Tuple			):
					if self.rope_scaling is None:
									return

					if not isinstance(self.rope_scaling							,A			) 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}'''			)
					__A             =			self.rope_scaling.get("type"							,A			)
					__A             =			self.rope_scaling.get("factor"							,A			)
					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(A							,A			) or rope_scaling_factor <= 1.0:
									raise ValueError(f'''`rope_scaling`\'s factor field must be an float > 1, got {rope_scaling_factor}'''			)


import copy
from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import Audio, Features, Value
from .base import TaskTemplate





@dataclass(frozen=__SCREAMING_SNAKE_CASE  )
class 							UpperCAmelCase				(  __SCREAMING_SNAKE_CASE  ):




	'''simple docstring'''





	snake_case_    =					field(default="automatic-speech-recognition"      ,      metadata={"include_in_asdict_even_if_is_default": True}  )
	snake_case_    =					Features({"audio": Audio()}  )
	snake_case_    =					Features({"transcription": Value("string"  )}  )
	snake_case_    =					"audio"
	snake_case_    =					"transcription"






	def     UpperCamelCase_  (	self :			Optional[int]							,A :			Union[str, Any]			):
					if self.audio_column not in features:
									raise ValueError(f'''Column {self.audio_column} is not present in features.'''			)
					if not isinstance(features[self.audio_column]							,A			):
									raise ValueError(f'''Column {self.audio_column} is not an Audio type.'''			)
					__A             =			copy.deepcopy(self			)
					__A             =			self.input_schema.copy()
					__A             =			features[self.audio_column]
					__A             =			input_schema
					return task_template







	@property
	def     UpperCamelCase_  (	self :			int			):
					return {self.audio_column: "audio", self.transcription_column: "transcription"}
