





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


__A       : Dict						    = logging.get_logger(__name__)

__A       : int						    = {
    "facebook/opt-125m": "https://huggingface.co/facebook/opt-125m/blob/main/config.json",
    "facebook/opt-350m": "https://huggingface.co/facebook/opt-350m/blob/main/config.json",
    "facebook/opt-1.3b": "https://huggingface.co/facebook/opt-1.3b/blob/main/config.json",
    "facebook/opt-2.7b": "https://huggingface.co/facebook/opt-2.7b/blob/main/config.json",
    "facebook/opt-6.7b": "https://huggingface.co/facebook/opt-6.7b/blob/main/config.json",
    "facebook/opt-13b": "https://huggingface.co/facebook/opt-13b/blob/main/config.json",
}







class     lowerCamelCase(	__snake_case  ):
     '''simple docstring'''


     __magic_name__        = 'opt'
     __magic_name__        = ['past_key_values']




     def __init__(						self							,    snake_case_=5_0272							,    snake_case_=768							,    snake_case_=12							,    snake_case_=3072							,    snake_case_=2048							,    snake_case_=True							,    snake_case_=False							,    snake_case_=None							,    snake_case_=0.1							,    snake_case_=0.0							,    snake_case_=12							,    snake_case_="relu"							,    snake_case_=0.0							,    snake_case_=0.02							,    snake_case_=True							,    snake_case_=1							,    snake_case_=2							,    snake_case_=2							,    snake_case_=True							,    snake_case_=True							,    **snake_case_							,    ):
         super().__init__(
             pad_token_id=snake_case_							,    bos_token_id=snake_case_							,    eos_token_id=snake_case_							,    **snake_case_							,    )
         _A    =       vocab_size
         _A    =       max_position_embeddings
         _A    =       num_attention_heads
         _A    =       word_embed_proj_dim if word_embed_proj_dim is not None else hidden_size
         _A    =       ffn_dim
         _A    =       hidden_size
         _A    =       num_hidden_layers
         _A    =       dropout
         _A    =       attention_dropout
         _A    =       activation_function
         _A    =       init_std
         _A    =       layerdrop
         _A    =       use_cache
         _A    =       do_layer_norm_before
         # We keep these variables at `True` for backward compatibility.
         _A    =       enable_bias
         _A    =       layer_norm_elementwise_affine

         # Note that the only purpose of `_remove_final_layer_norm` is to keep backward compatibility
         # with checkpoints that have been fine-tuned before transformers v4.20.1
         # see https://github.com/facebookresearch/metaseq/pull/164
         _A    =       _remove_final_layer_norm












from sklearn.metrics import accuracy_score

import datasets


__A       : Union[str, Any]						    = "\nAccuracy is the proportion of correct predictions among the total number of cases processed. It can be computed with:\nAccuracy = (TP + TN) / (TP + TN + FP + FN)\n Where:\nTP: True positive\nTN: True negative\nFP: False positive\nFN: False negative\n"


__A       : List[Any]						    = "\nArgs:\n    predictions (`list` of `int`): Predicted labels.\n    references (`list` of `int`): Ground truth labels.\n    normalize (`boolean`): If set to False, returns the number of correctly classified samples. Otherwise, returns the fraction of correctly classified samples. Defaults to True.\n    sample_weight (`list` of `float`): Sample weights Defaults to None.\n\nReturns:\n    accuracy (`float` or `int`): Accuracy score. Minimum possible value is 0. Maximum possible value is 1.0, or the number of examples input, if `normalize` is set to `True`.. A higher score means higher accuracy.\n\nExamples:\n\n    Example 1-A simple example\n        >>> accuracy_metric = datasets.load_metric(\"accuracy\")\n        >>> results = accuracy_metric.compute(references=[0, 1, 2, 0, 1, 2], predictions=[0, 1, 1, 2, 1, 0])\n        >>> print(results)\n        {'accuracy': 0.5}\n\n    Example 2-The same as Example 1, except with `normalize` set to `False`.\n        >>> accuracy_metric = datasets.load_metric(\"accuracy\")\n        >>> results = accuracy_metric.compute(references=[0, 1, 2, 0, 1, 2], predictions=[0, 1, 1, 2, 1, 0], normalize=False)\n        >>> print(results)\n        {'accuracy': 3.0}\n\n    Example 3-The same as Example 1, except with `sample_weight` set.\n        >>> accuracy_metric = datasets.load_metric(\"accuracy\")\n        >>> results = accuracy_metric.compute(references=[0, 1, 2, 0, 1, 2], predictions=[0, 1, 1, 2, 1, 0], sample_weight=[0.5, 2, 0.7, 0.5, 9, 0.4])\n        >>> print(results)\n        {'accuracy': 0.8778625954198473}\n"


__A       : List[str]						    = "\n@article{scikit-learn,\n  title={Scikit-learn: Machine Learning in {P}ython},\n  author={Pedregosa, F. and Varoquaux, G. and Gramfort, A. and Michel, V.\n         and Thirion, B. and Grisel, O. and Blondel, M. and Prettenhofer, P.\n         and Weiss, R. and Dubourg, V. and Vanderplas, J. and Passos, A. and\n         Cournapeau, D. and Brucher, M. and Perrot, M. and Duchesnay, E.},\n  journal={Journal of Machine Learning Research},\n  volume={12},\n  pages={2825--2830},\n  year={2011}\n}\n"







@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION ,   _KWARGS_DESCRIPTION  )
class     lowerCamelCase(	datasets.Metric  ):
     '''simple docstring'''


     def 					lowerCAmelCase__		(						self       ):
         return datasets.MetricInfo(
             description=_DESCRIPTION							,    citation=_CITATION							,    inputs_description=_KWARGS_DESCRIPTION							,    features=datasets.Features(
                 {
                     'predictions': datasets.Sequence(datasets.Value('int32'       )       ),
                     'references': datasets.Sequence(datasets.Value('int32'       )       ),
                 }
                 if self.config_name == 'multilabel'
                 else {
                     'predictions': datasets.Value('int32'       ),
                     'references': datasets.Value('int32'       ),
                 }       )							,    reference_urls=['https://scikit-learn.org/stable/modules/generated/sklearn.metrics.accuracy_score.html']							,    )




     def 					lowerCAmelCase__		(						self							,    snake_case_							,    snake_case_							,    snake_case_=True							,    snake_case_=None       ):
         return {
             "accuracy": float(
                 accuracy_score(snake_case_							,    snake_case_							,    normalize=snake_case_							,    sample_weight=snake_case_       )       )
         }





