



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


_lowercase						  =		logging.get_logger(__name__)

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



class     _UpperCAmelCase			(       A__     ):
     UpperCamelCase__		    =				'''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.0_2 ,						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__ ,						):
         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 		snake_case_		(				self):
         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 numpy as np
from matplotlib import pyplot as plt
from sklearn.datasets import load_iris
from sklearn.metrics import ConfusionMatrixDisplay
from sklearn.model_selection import train_test_split
from xgboost import XGBClassifier



def 		lowerCAmelCase__    (					UpperCamelCase_				:       dict	)->  tuple:
    return (data["data"], data["target"])



def 		lowerCAmelCase__    (					UpperCamelCase_				:       np.ndarray ,       UpperCamelCase_				:       np.ndarray	)->  XGBClassifier:
    A__		 =					XGBClassifier()
    classifier.fit(UpperCamelCase_ ,       UpperCamelCase_	)
    return classifier



def 		lowerCAmelCase__    (					)->  None:
    A__		 =					load_iris()
    A__ ,	A__		 =					data_handling(UpperCamelCase_	)
    A__ ,	A__ ,	A__ ,	A__		 =					train_test_split(
        UpperCamelCase_ ,       UpperCamelCase_ ,       test_size=0.25	)

    A__		 =					iris['''target_names''']

    # Create an XGBoost Classifier from the training data
    A__		 =					xgboost(UpperCamelCase_ ,       UpperCamelCase_	)

    # Display the confusion matrix of the classifier with both training and test sets
    ConfusionMatrixDisplay.from_estimator(
        UpperCamelCase_ ,       UpperCamelCase_ ,       UpperCamelCase_ ,       display_labels=UpperCamelCase_ ,       cmap='''Blues''' ,       normalize='''true''' ,       )
    plt.title('''Normalized Confusion Matrix - IRIS Dataset'''	)
    plt.show()


if __name__ == "__main__":
   import doctest

   doctest.testmod(verbose=True)
   main()
