



'''simple docstring'''






from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


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

A_							: Tuple						 =	{
    """facebook/xlm-roberta-xl""": """https://huggingface.co/facebook/xlm-roberta-xl/resolve/main/config.json""",
    """facebook/xlm-roberta-xxl""": """https://huggingface.co/facebook/xlm-roberta-xxl/resolve/main/config.json""",
    # See all XLM-RoBERTa-XL models at https://huggingface.co/models?filter=xlm-roberta-xl
}



class 							lowercase       (  _lowerCamelCase				):


 """simple docstring"""


 UpperCAmelCase							=  """xlm-roberta-xl"""







 def __init__(							self  ,a_=250_880  ,a_=2_560  ,a_=36  ,a_=32  ,a_=10_240  ,a_="gelu"  ,a_=0.1  ,a_=0.1  ,a_=514  ,a_=1  ,a_=0.02  ,a_=1E-0_5  ,a_=1  ,a_=0  ,a_=2  ,a_="absolute"  ,a_=True  ,a_=None  ,**a_  ,)		->   Any:
        super().__init__(pad_token_id=a_  ,bos_token_id=a_  ,eos_token_id=a_  ,**a_							)
        _UpperCAmelCase  :						List[str]			     = vocab_size
        _UpperCAmelCase  :						Any			     = hidden_size
        _UpperCAmelCase  :						Tuple			     = num_hidden_layers
        _UpperCAmelCase  :						Optional[int]			     = num_attention_heads
        _UpperCAmelCase  :						str			     = hidden_act
        _UpperCAmelCase  :						Tuple			     = intermediate_size
        _UpperCAmelCase  :						List[Any]			     = hidden_dropout_prob
        _UpperCAmelCase  :						Union[str, Any]			     = attention_probs_dropout_prob
        _UpperCAmelCase  :						str			     = max_position_embeddings
        _UpperCAmelCase  :						str			     = type_vocab_size
        _UpperCAmelCase  :						List[Any]			     = initializer_range
        _UpperCAmelCase  :						str			     = layer_norm_eps
        _UpperCAmelCase  :						str			     = position_embedding_type
        _UpperCAmelCase  :						List[str]			     = use_cache
        _UpperCAmelCase  :						Tuple			     = classifier_dropout







class 							lowercase       (  _lowerCamelCase				):


 """simple docstring"""


 @property
 def _snake_case (							self							)		->   Mapping[str, Mapping[int, str]]:
        if self.task == "multiple-choice":
               _UpperCAmelCase  :						Any			     = {0: """batch""", 1: """choice""", 2: """sequence"""}
        else:
               _UpperCAmelCase  :						Union[str, Any]			     = {0: """batch""", 1: """sequence"""}
        return OrderedDict(
            [
                ("""input_ids""", dynamic_axis),
                ("""attention_mask""", dynamic_axis),
            ]							)








'''simple docstring'''






import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin



class 							lowercase       (  unittest.TestCase					,					_lowerCamelCase				):


 """simple docstring"""


 def _snake_case (							self							)		->   Any:
        _UpperCAmelCase  :						int			     = load_tool("""text-classification"""							)
        self.tool.setup()
        _UpperCAmelCase  :						Tuple			     = load_tool("""text-classification"""  ,remote=a_							)







 def _snake_case (							self							)		->   Union[str, Any]:
        _UpperCAmelCase  :						Tuple			     = self.tool("""That's quite cool"""  ,["""positive""", """negative"""]							)
        self.assertEqual(a_  ,"""positive"""							)







 def _snake_case (							self							)		->   Any:
        _UpperCAmelCase  :						Dict			     = self.remote_tool("""That's quite cool"""  ,["""positive""", """negative"""]							)
        self.assertEqual(a_  ,"""positive"""							)







 def _snake_case (							self							)		->   str:
        _UpperCAmelCase  :						List[Any]			     = self.tool(text="""That's quite cool"""  ,labels=["""positive""", """negative"""]							)
        self.assertEqual(a_  ,"""positive"""							)







 def _snake_case (							self							)		->   Union[str, Any]:
        _UpperCAmelCase  :						Any			     = self.remote_tool(text="""That's quite cool"""  ,labels=["""positive""", """negative"""]							)
        self.assertEqual(a_  ,"""positive"""							)



