






from collections import OrderedDict
from typing import Mapping

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


SCREAMING_SNAKE_CASE 							=						logging.get_logger(__name__)

SCREAMING_SNAKE_CASE 							=						{
    '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 							A_    (						__lowercase			):






 '''simple docstring'''




 _SCREAMING_SNAKE_CASE							:			Dict =					"xlm-roberta-xl"


 def __init__(	self							,  _A=250880							,  _A=2560							,  _A=36							,  _A=32							,  _A=10240							,  _A="gelu"							,  _A=0.1							,  _A=0.1							,  _A=514							,  _A=1							,  _A=0.02							,  _A=1e-05							,  _A=1							,  _A=0							,  _A=2							,  _A="absolute"							,  _A=True							,  _A=None							,  **_A							,  ) ->		Any:

     """simple docstring"""



     super().__init__(pad_token_id=_A							,  bos_token_id=_A							,  eos_token_id=_A							,  **_A)
     _UpperCAmelCase				:      Any			  =				vocab_size
     _UpperCAmelCase				:      Union[str, Any]			  =				hidden_size
     _UpperCAmelCase				:      Tuple			  =				num_hidden_layers
     _UpperCAmelCase				:      Union[str, Any]			  =				num_attention_heads
     _UpperCAmelCase				:      str			  =				hidden_act
     _UpperCAmelCase				:      Union[str, Any]			  =				intermediate_size
     _UpperCAmelCase				:      Any			  =				hidden_dropout_prob
     _UpperCAmelCase				:      int			  =				attention_probs_dropout_prob
     _UpperCAmelCase				:      int			  =				max_position_embeddings
     _UpperCAmelCase				:      Tuple			  =				type_vocab_size
     _UpperCAmelCase				:      Any			  =				initializer_range
     _UpperCAmelCase				:      str			  =				layer_norm_eps
     _UpperCAmelCase				:      Any			  =				position_embedding_type
     _UpperCAmelCase				:      int			  =				use_cache
     _UpperCAmelCase				:      int			  =				classifier_dropout



class 							A_    (						__lowercase			):






 '''simple docstring'''




 @property
 def  snake_case__				(	self) ->		Mapping[str, Mapping[int, str]]:

     """simple docstring"""



     if self.task == "multiple-choice":
         _UpperCAmelCase				:      List[Any]			  =				{0: '''batch''', 1: '''choice''', 2: '''sequence'''}
     else:
         _UpperCAmelCase				:      List[Any]			  =				{0: '''batch''', 1: '''sequence'''}
     return OrderedDict(
         [
             ('''input_ids''', dynamic_axis),
             ('''attention_mask''', dynamic_axis),
         ])












import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


SCREAMING_SNAKE_CASE 							=						'\nHugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf originally as a company that developed a chatbot app targeted at teenagers.[2] After open-sourcing the model behind the chatbot, the company pivoted to focus on being a platform for machine learning.\n\nIn March 2021, Hugging Face raised $40 million in a Series B funding round.[3]\n\nOn April 28, 2021, the company launched the BigScience Research Workshop in collaboration with several other research groups to release an open large language model.[4] In 2022, the workshop concluded with the announcement of BLOOM, a multilingual large language model with 176 billion parameters.[5]\n'
class 							A_    (						unittest.TestCase ,   __lowercase			):






 '''simple docstring'''




 def  snake_case__				(	self) ->		int:

     """simple docstring"""



     _UpperCAmelCase				:      int			  =				load_tool('''text-question-answering''')
     self.tool.setup()
     _UpperCAmelCase				:      Any			  =				load_tool('''text-question-answering'''							,  remote=_A)


 def  snake_case__				(	self) ->		Union[str, Any]:

     """simple docstring"""



     _UpperCAmelCase				:      Optional[Any]			  =				self.tool(_A							,  '''What did Hugging Face do in April 2021?''')
     self.assertEqual(_A							,  '''launched the BigScience Research Workshop''')


 def  snake_case__				(	self) ->		str:

     """simple docstring"""



     _UpperCAmelCase				:      str			  =				self.remote_tool(_A							,  '''What did Hugging Face do in April 2021?''')
     self.assertEqual(_A							,  '''launched the BigScience Research Workshop''')


 def  snake_case__				(	self) ->		Optional[int]:

     """simple docstring"""



     _UpperCAmelCase				:      Dict			  =				self.tool(text=_A							,  question='''What did Hugging Face do in April 2021?''')
     self.assertEqual(_A							,  '''launched the BigScience Research Workshop''')


 def  snake_case__				(	self) ->		Dict:

     """simple docstring"""



     _UpperCAmelCase				:      Optional[int]			  =				self.remote_tool(text=_A							,  question='''What did Hugging Face do in April 2021?''')
     self.assertEqual(_A							,  '''launched the BigScience Research Workshop''')




