





from collections import OrderedDict
from typing import Mapping

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


SCREAMING_SNAKE_CASE__       :			Optional[int]			      =						logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__       :			Optional[int]			      =						{
    """xlm-roberta-base""": """https://huggingface.co/xlm-roberta-base/resolve/main/config.json""",
    """xlm-roberta-large""": """https://huggingface.co/xlm-roberta-large/resolve/main/config.json""",
    """xlm-roberta-large-finetuned-conll02-dutch""": (
        """https://huggingface.co/xlm-roberta-large-finetuned-conll02-dutch/resolve/main/config.json"""
    ),
    """xlm-roberta-large-finetuned-conll02-spanish""": (
        """https://huggingface.co/xlm-roberta-large-finetuned-conll02-spanish/resolve/main/config.json"""
    ),
    """xlm-roberta-large-finetuned-conll03-english""": (
        """https://huggingface.co/xlm-roberta-large-finetuned-conll03-english/resolve/main/config.json"""
    ),
    """xlm-roberta-large-finetuned-conll03-german""": (
        """https://huggingface.co/xlm-roberta-large-finetuned-conll03-german/resolve/main/config.json"""
    ),
}







class   __lowerCAmelCase			(					_UpperCamelCase  ):
   _UpperCamelCase :						List[str]     		=				"""xlm-roberta"""





   def __init__( self					,			snake_case=30_522					,			snake_case=768					,			snake_case=12					,			snake_case=12					,			snake_case=3_072					,			snake_case="gelu"					,			snake_case=0.1					,			snake_case=0.1					,			snake_case=512					,			snake_case=2					,			snake_case=0.02					,			snake_case=1E-12					,			snake_case=1					,			snake_case=0					,			snake_case=2					,			snake_case="absolute"					,			snake_case=True					,			snake_case=None					,			**snake_case					,			)				->  Optional[int]:
      """simple docstring"""





      super().__init__(pad_token_id=snake_case					,			bos_token_id=snake_case					,			eos_token_id=snake_case					,			**snake_case      )

      a__	:						List[str]      		=  vocab_size
      a__	:						str      		=  hidden_size
      a__	:						Any      		=  num_hidden_layers
      a__	:						Optional[Any]      		=  num_attention_heads
      a__	:						Any      		=  hidden_act
      a__	:						Optional[int]      		=  intermediate_size
      a__	:						Optional[Any]      		=  hidden_dropout_prob
      a__	:						Dict      		=  attention_probs_dropout_prob
      a__	:						str      		=  max_position_embeddings
      a__	:						Tuple      		=  type_vocab_size
      a__	:						str      		=  initializer_range
      a__	:						Optional[int]      		=  layer_norm_eps
      a__	:						Any      		=  position_embedding_type
      a__	:						Optional[Any]      		=  use_cache
      a__	:						Tuple      		=  classifier_dropout







class   __lowerCAmelCase			(					_UpperCamelCase  ):





   @property
   def 	_snake_case ( self      )				->  Mapping[str, Mapping[int, str]]:
      """simple docstring"""





      if self.task == "multiple-choice":
         a__	:						Union[str, Any]      		=  {0: "batch", 1: "choice", 2: "sequence"}
      else:
         a__	:						Union[str, 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__       :			Dict			      =						"""
Hugging 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.

In March 2021, Hugging Face raised $40 million in a Series B funding round.[3]

On 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]
"""







class   __lowerCAmelCase			(					unittest.TestCase		,_UpperCamelCase  ):





   def 	_snake_case ( self      )				->  str:
      """simple docstring"""





      a__	:						Optional[int]      		=  load_tool("text-question-answering"      )
      self.tool.setup()
      a__	:						Dict      		=  load_tool("text-question-answering"					,			remote=snake_case      )





   def 	_snake_case ( self      )				->  Dict:
      """simple docstring"""





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





   def 	_snake_case ( self      )				->  Tuple:
      """simple docstring"""





      a__	:						List[Any]      		=  self.remote_tool(snake_case					,			"What did Hugging Face do in April 2021?"      )
      self.assertEqual(snake_case					,			"launched the BigScience Research Workshop"      )





   def 	_snake_case ( self      )				->  Any:
      """simple docstring"""





      a__	:						Any      		=  self.tool(text=snake_case					,			question="What did Hugging Face do in April 2021?"      )
      self.assertEqual(snake_case					,			"launched the BigScience Research Workshop"      )





   def 	_snake_case ( self      )				->  int:
      """simple docstring"""





      a__	:						List[str]      		=  self.remote_tool(text=snake_case					,			question="What did Hugging Face do in April 2021?"      )
      self.assertEqual(snake_case					,			"launched the BigScience Research Workshop"      )

