





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


UpperCamelCase__   : Any					  = logging.get_logger(__name__)

UpperCamelCase__   : Optional[int]					  = {
    """s-JoL/Open-Llama-V1""": """https://huggingface.co/s-JoL/Open-Llama-V1/blob/main/config.json""",
}







class   _UpperCamelCase  (       A_  ):







					'''simple docstring'''

					lowerCamelCase     :     Optional[int]			    =       'open-llama'





					def __init__(						self    :  Dict ,					__lowercase    :  Optional[Any]=10_00_00 ,					__lowercase    :  List[str]=40_96 ,					__lowercase    :  int=1_10_08 ,					__lowercase    :  List[str]=32 ,					__lowercase    :  Tuple=32 ,					__lowercase    :  int="silu" ,					__lowercase    :  Dict=20_48 ,					__lowercase    :  Optional[Any]=0.02 ,					__lowercase    :  List[Any]=1e-6 ,					__lowercase    :  str=True ,					__lowercase    :  Union[str, Any]=0 ,					__lowercase    :  Union[str, Any]=1 ,					__lowercase    :  Optional[Any]=2 ,					__lowercase    :  Optional[int]=False ,					__lowercase    :  List[str]=True ,					__lowercase    :  Optional[int]=0.1 ,					__lowercase    :  Optional[Any]=0.1 ,					__lowercase    :  Optional[int]=True ,					__lowercase    :  Tuple=True ,					__lowercase    :  Union[str, Any]=None ,					**__lowercase    :  Any ,					):






						'''simple docstring'''







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

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





					def        SCREAMING_SNAKE_CASE							(						self    :  Union[str, Any]		):






						'''simple docstring'''







						if self.rope_scaling is None:
							return

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









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


UpperCamelCase__   : Any					  = logging.get_logger(__name__)

UpperCamelCase__   : int					  = {
    """CarlCochet/trajectory-transformer-halfcheetah-medium-v2""": (
        """https://huggingface.co/CarlCochet/trajectory-transformer-halfcheetah-medium-v2/resolve/main/config.json"""
    ),
    # See all TrajectoryTransformer models at https://huggingface.co/models?filter=trajectory_transformer
}







class   _UpperCamelCase  (       A_  ):







					'''simple docstring'''

					lowerCamelCase     :     Tuple			    =       'trajectory_transformer'
					lowerCamelCase     :     Optional[Any]			    =       ['past_key_values']
					lowerCamelCase     :     Tuple			    =       {
					    'hidden_size': 'n_embd',
					    'num_attention_heads': 'n_head',
					    'num_hidden_layers': 'n_layer',
					}





					def __init__(						self    :  Union[str, Any] ,					__lowercase    :  Optional[Any]=1_00 ,					__lowercase    :  int=5 ,					__lowercase    :  str=1 ,					__lowercase    :  Union[str, Any]=1 ,					__lowercase    :  Optional[Any]=2_49 ,					__lowercase    :  Tuple=6 ,					__lowercase    :  Tuple=17 ,					__lowercase    :  List[str]=25 ,					__lowercase    :  Tuple=4 ,					__lowercase    :  Dict=4 ,					__lowercase    :  int=1_28 ,					__lowercase    :  List[str]=0.1 ,					__lowercase    :  Optional[Any]=0.1 ,					__lowercase    :  Union[str, Any]=0.1 ,					__lowercase    :  Tuple=0.0006 ,					__lowercase    :  Optional[int]=5_12 ,					__lowercase    :  Any=0.02 ,					__lowercase    :  Tuple=1e-12 ,					__lowercase    :  Optional[Any]=1 ,					__lowercase    :  Dict=True ,					__lowercase    :  Optional[Any]=1 ,					__lowercase    :  str=5_02_56 ,					__lowercase    :  Any=5_02_56 ,					**__lowercase    :  str ,					):






						'''simple docstring'''







						UpperCAmelCase_								=     vocab_size
						UpperCAmelCase_								=     action_weight
						UpperCAmelCase_								=     reward_weight
						UpperCAmelCase_								=     value_weight
						UpperCAmelCase_								=     max_position_embeddings
						UpperCAmelCase_								=     block_size
						UpperCAmelCase_								=     action_dim
						UpperCAmelCase_								=     observation_dim
						UpperCAmelCase_								=     transition_dim
						UpperCAmelCase_								=     learning_rate
						UpperCAmelCase_								=     n_layer
						UpperCAmelCase_								=     n_head
						UpperCAmelCase_								=     n_embd
						UpperCAmelCase_								=     embd_pdrop
						UpperCAmelCase_								=     attn_pdrop
						UpperCAmelCase_								=     resid_pdrop
						UpperCAmelCase_								=     initializer_range
						UpperCAmelCase_								=     layer_norm_eps
						UpperCAmelCase_								=     kaiming_initializer_range
						UpperCAmelCase_								=     use_cache
						super().__init__(pad_token_id=__lowercase ,					bos_token_id=__lowercase ,					eos_token_id=__lowercase ,					**__lowercase		)


