


"""simple docstring"""





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


_UpperCamelCase     :		int											=					logging.get_logger(__name__)

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


class   UpperCAmelCase_			(					_a):
      lowerCamelCase__	:					Optional[int]										=						"open-llama"


      def __init__(     self	,    a=1_0_0_0_0_0	,    a=4_0_9_6	,    a=1_1_0_0_8	,    a=3_2	,    a=3_2	,    a="silu"	,    a=2_0_4_8	,    a=0.02	,    a=1e-6	,    a=True	,    a=0	,    a=1	,    a=2	,    a=False	,    a=True	,    a=0.1	,    a=0.1	,    a=True	,    a=True	,    a=None	,    **a	,    ) ->      Optional[Any]:
             lowercase__    :	List[Any]     					=			vocab_size
             lowercase__    :	Union[str, Any]     					=			max_position_embeddings
             lowercase__    :	List[str]     					=			hidden_size
             lowercase__    :	Union[str, Any]     					=			intermediate_size
             lowercase__    :	Dict     					=			num_hidden_layers
             lowercase__    :	Dict     					=			num_attention_heads
             lowercase__    :	str     					=			hidden_act
             lowercase__    :	Union[str, Any]     					=			initializer_range
             lowercase__    :	Any     					=			rms_norm_eps
             lowercase__    :	List[Any]     					=			use_cache
             lowercase__    :	Any     					=			kwargs.pop(
                 'use_memorry_efficient_attention'	,    a							)
             lowercase__    :	Dict     					=			hidden_dropout_prob
             lowercase__    :	List[str]     					=			attention_dropout_prob
             lowercase__    :	Tuple     					=			use_stable_embedding
             lowercase__    :	Optional[Any]     					=			shared_input_output_embedding
             lowercase__    :	Optional[Any]     					=			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							) ->      str:
             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}"""							)
             lowercase__    :	Dict     					=			self.rope_scaling.get('type'	,    a							)
             lowercase__    :	Union[str, Any]     					=			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}"""							)


"""simple docstring"""





import numpy as np
from sklearn.datasets import fetch_california_housing
from sklearn.metrics import mean_absolute_error, mean_squared_error
from sklearn.model_selection import train_test_split
from xgboost import XGBRegressor





def        a_  (   _lowerCAmelCase						:				dict  ):





       '''simple docstring'''

       return (data["data"], data["target"])





def        a_  (   _lowerCAmelCase						:				np.ndarray     ,				_lowerCAmelCase						:				np.ndarray     ,				_lowerCAmelCase						:				np.ndarray  ):





       '''simple docstring'''

       lowercase__    :	Any     					=			XGBRegressor(verbosity=0     ,				random_state=42  )
       xgb.fit(_lowerCAmelCase     ,				_lowerCAmelCase  )
       # Predict target for test data
       lowercase__    :	str     					=			xgb.predict(_lowerCAmelCase  )
       lowercase__    :	Union[str, Any]     					=			predictions.reshape(len(_lowerCAmelCase  )     ,				1  )
       return predictions





def        a_  (   ):





       '''simple docstring'''

       lowercase__    :	Optional[Any]     					=			fetch_california_housing()
       lowercase__					,   lowercase__    :	str     					=			data_handling(_lowerCAmelCase  )
       lowercase__					,   lowercase__					,   lowercase__					,   lowercase__    :	str     					=			train_test_split(
           _lowerCAmelCase     ,				_lowerCAmelCase     ,				test_size=0.2_5     ,				random_state=1  )
       lowercase__    :	Any     					=			xgboost(_lowerCAmelCase     ,				_lowerCAmelCase     ,				_lowerCAmelCase  )
       # Error printing
       print(f"""Mean Absolute Error : {mean_absolute_error(_lowerCAmelCase     ,				_lowerCAmelCase  )}"""  )
       print(f"""Mean Square Error  : {mean_squared_error(_lowerCAmelCase     ,				_lowerCAmelCase  )}"""  )


if __name__ == "__main__":
       import doctest

       doctest.testmod(verbose=True)
       main()

