






'''simple docstring'''







from scipy.stats import spearmanr

import datasets


_A			:    Tuple					  ='''
The Spearman rank-order correlation coefficient is a measure of the
relationship between two datasets. Like other correlation coefficients,
this one varies between -1 and +1 with 0 implying no correlation.
Positive correlations imply that as data in dataset x increases, so
does data in dataset y. Negative correlations imply that as x increases,
y decreases. Correlations of -1 or +1 imply an exact monotonic relationship.

Unlike the Pearson correlation, the Spearman correlation does not
assume that both datasets are normally distributed.

The p-value roughly indicates the probability of an uncorrelated system
producing datasets that have a Spearman correlation at least as extreme
as the one computed from these datasets. The p-values are not entirely
reliable but are probably reasonable for datasets larger than 500 or so.
'''

_A			:    Union[str, Any]					  ='''
Args:
    predictions (`List[float]`): Predicted labels, as returned by a model.
    references (`List[float]`): Ground truth labels.
    return_pvalue (`bool`): If `True`, returns the p-value. If `False`, returns
            only the spearmanr score. Defaults to `False`.
Returns:
    spearmanr (`float`): Spearman correlation coefficient.
    p-value (`float`): p-value. **Note**: is only returned if `return_pvalue=True` is input.
Examples:
    Example 1:
        >>> spearmanr_metric = datasets.load_metric("spearmanr")
        >>> results = spearmanr_metric.compute(references=[1, 2, 3, 4, 5], predictions=[10, 9, 2.5, 6, 4])
        >>> print(results)
        {\'spearmanr\': -0.7}

    Example 2:
        >>> spearmanr_metric = datasets.load_metric("spearmanr")
        >>> results = spearmanr_metric.compute(references=[1, 2, 3, 4, 5],
        ...                                     predictions=[10, 9, 2.5, 6, 4],
        ...                                     return_pvalue=True)
        >>> print(results[\'spearmanr\'])
        -0.7
        >>> print(round(results[\'spearmanr_pvalue\'], 2))
        0.19
'''

_A			:    Optional[Any]					  =r'''\
@book{kokoska2000crc,
  title={CRC standard probability and statistics tables and formulae},
  author={Kokoska, Stephen and Zwillinger, Daniel},
  year={2000},
  publisher={Crc Press}
}
@article{2020SciPy-NMeth,
  author  = {Virtanen, Pauli and Gommers, Ralf and Oliphant, Travis E. and
            Haberland, Matt and Reddy, Tyler and Cournapeau, David and
            Burovski, Evgeni and Peterson, Pearu and Weckesser, Warren and
            Bright, Jonathan and {van der Walt}, St{\'e}fan J. and
            Brett, Matthew and Wilson, Joshua and Millman, K. Jarrod and
            Mayorov, Nikolay and Nelson, Andrew R. J. and Jones, Eric and
            Kern, Robert and Larson, Eric and Carey, C J and
            Polat, {\.I}lhan and Feng, Yu and Moore, Eric W. and
            {VanderPlas}, Jake and Laxalde, Denis and Perktold, Josef and
            Cimrman, Robert and Henriksen, Ian and Quintero, E. A. and
            Harris, Charles R. and Archibald, Anne M. and
            Ribeiro, Ant{\^o}nio H. and Pedregosa, Fabian and
            {van Mulbregt}, Paul and {SciPy 1.0 Contributors}},
  title   = {{{SciPy} 1.0: Fundamental Algorithms for Scientific
            Computing in Python}},
  journal = {Nature Methods},
  year    = {2020},
  volume  = {17},
  pages   = {261--272},
  adsurl  = {https://rdcu.be/b08Wh},
  doi     = {10.1038/s41592-019-0686-2},
}
'''

@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION       ,   _KWARGS_DESCRIPTION	)
class _lowercase			(       datasets.Metric	):




							def 	lowerCamelCase_       (							self:       Any  ):
														return datasets.MetricInfo(
														    description=_DESCRIPTION    ,							citation=_CITATION    ,							inputs_description=_KWARGS_DESCRIPTION    ,							features=datasets.Features(
														        {
														            """predictions""": datasets.Value("""float"""  ),
														            """references""": datasets.Value("""float"""  ),
														        }  )    ,							reference_urls=["""https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.spearmanr.html"""]    ,							)




							def 	lowerCamelCase_       (							self:       Tuple    ,							UpperCamelCase__:       str    ,							UpperCamelCase__:       Dict    ,							UpperCamelCase__:       Union[str, Any]=False  ):
														lowerCamelCase__      :			Optional[Any] 						= spearmanr(UpperCamelCase__    ,							UpperCamelCase__  )
														if return_pvalue:
																					return {"spearmanr": results[0], "spearmanr_pvalue": results[1]}
														else:
																					return {"spearmanr": results[0]}









'''simple docstring'''







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


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

_A			:    Optional[int]					  ={
    '''RWKV/rwkv-4-169m-pile''': '''https://huggingface.co/RWKV/rwkv-4-169m-pile/resolve/main/config.json''',
    '''RWKV/rwkv-4-430m-pile''': '''https://huggingface.co/RWKV/rwkv-4-430m-pile/resolve/main/config.json''',
    '''RWKV/rwkv-4-1b5-pile''': '''https://huggingface.co/RWKV/rwkv-4-1b5-pile/resolve/main/config.json''',
    '''RWKV/rwkv-4-3b-pile''': '''https://huggingface.co/RWKV/rwkv-4-3b-pile/resolve/main/config.json''',
    '''RWKV/rwkv-4-7b-pile''': '''https://huggingface.co/RWKV/rwkv-4-7b-pile/resolve/main/config.json''',
    '''RWKV/rwkv-4-14b-pile''': '''https://huggingface.co/RWKV/rwkv-4-14b-pile/resolve/main/config.json''',
    '''RWKV/rwkv-raven-1b5''': '''https://huggingface.co/RWKV/rwkv-raven-1b5/resolve/main/config.json''',
    '''RWKV/rwkv-raven-3b''': '''https://huggingface.co/RWKV/rwkv-raven-3b/resolve/main/config.json''',
    '''RWKV/rwkv-raven-7b''': '''https://huggingface.co/RWKV/rwkv-raven-7b/resolve/main/config.json''',
    '''RWKV/rwkv-raven-14b''': '''https://huggingface.co/RWKV/rwkv-raven-14b/resolve/main/config.json''',
}

class _lowercase			(       _lowercase	):
							a          = """rwkv"""
							a          = {"""max_position_embeddings""": """context_length"""}




							def __init__(							self:       Tuple    ,							UpperCamelCase__:       Optional[Any]=50_277    ,							UpperCamelCase__:       Union[str, Any]=1_024    ,							UpperCamelCase__:       Tuple=4_096    ,							UpperCamelCase__:       List[Any]=32    ,							UpperCamelCase__:       Dict=None    ,							UpperCamelCase__:       Dict=None    ,							UpperCamelCase__:       int=1e-5    ,							UpperCamelCase__:       Any=0    ,							UpperCamelCase__:       str=0    ,							UpperCamelCase__:       Union[str, Any]=6    ,							UpperCamelCase__:       Optional[int]=False    ,							UpperCamelCase__:       Dict=True    ,							**UpperCamelCase__:       Dict    ,							):
														lowerCamelCase__      :			Dict 						= vocab_size
														lowerCamelCase__      :			Optional[Any] 						= context_length
														lowerCamelCase__      :			Optional[Any] 						= hidden_size
														lowerCamelCase__      :			Any 						= num_hidden_layers
														lowerCamelCase__      :			int 						= attention_hidden_size if attention_hidden_size is not None else hidden_size
														lowerCamelCase__      :			Union[str, Any] 						= intermediate_size if intermediate_size is not None else 4 * hidden_size
														lowerCamelCase__      :			List[str] 						= layer_norm_epsilon
														lowerCamelCase__      :			int 						= rescale_every
														lowerCamelCase__      :			Optional[int] 						= use_cache

														lowerCamelCase__      :			Dict 						= bos_token_id
														lowerCamelCase__      :			Any 						= eos_token_id

														super().__init__(
														    tie_word_embeddings=UpperCamelCase__    ,							bos_token_id=UpperCamelCase__    ,							eos_token_id=UpperCamelCase__    ,							**UpperCamelCase__  )

