



# tests directory-specific settings - this file is run automatically
# by pytest before any tests are run

import doctest
import sys
import warnings
from os.path import abspath, dirname, join

import _pytest

from transformers.testing_utils import HfDoctestModule, HfDocTestParser


# allow having multiple repository checkouts and not needing to remember to rerun
# 'pip install -e .[dev]' when switching between checkouts and running tests.
SCREAMING_SNAKE_CASE_:int					=						abspath(join(dirname(__file__), """src"""))
sys.path.insert(1, git_repo_path)

# silence FutureWarning warnings in tests since often we can't act on them until
# they become normal warnings - i.e. the tests still need to test the current functionality
warnings.simplefilter(action="""ignore""", category=FutureWarning)




def      __UpperCamelCase     (  _lowerCAmelCase		)	->  Any:



       """simple docstring"""






       config.addinivalue_line(
           """markers"""				,					"""is_pt_tf_cross_test: mark test to run only when PT and TF interactions are tested"""		)
       config.addinivalue_line(
           """markers"""				,					"""is_pt_flax_cross_test: mark test to run only when PT and FLAX interactions are tested"""		)
       config.addinivalue_line("""markers"""				,					"""is_pipeline_test: mark test to run only when pipelines are tested"""		)
       config.addinivalue_line("""markers"""				,					"""is_staging_test: mark test to run only in the staging environment"""		)
       config.addinivalue_line("""markers"""				,					"""accelerate_tests: mark test that require accelerate"""		)
       config.addinivalue_line("""markers"""				,					"""tool_tests: mark the tool tests that are run on their specific schedule"""		)




def      __UpperCamelCase     (  _lowerCAmelCase		)	->  int:



       """simple docstring"""






       from transformers.testing_utils import pytest_addoption_shared

       pytest_addoption_shared(_lowerCAmelCase		)




def      __UpperCamelCase     (  _lowerCAmelCase		)	->  Dict:



       """simple docstring"""






       from transformers.testing_utils import pytest_terminal_summary_main

       A			:	Optional[int]										=       terminalreporter.config.getoption("""--make-reports"""		)
       if make_reports:
              pytest_terminal_summary_main(_lowerCAmelCase				,					id=_lowerCAmelCase		)




def      __UpperCamelCase     (  _lowerCAmelCase				,					_lowerCAmelCase		)	->  Optional[Any]:



       """simple docstring"""






       if exitstatus == 5:
              A			:	Optional[Any]										=       0


# Doctest custom flag to ignore output.
SCREAMING_SNAKE_CASE_:List[Any]					=						doctest.register_optionflag("""IGNORE_RESULT""")

SCREAMING_SNAKE_CASE_:List[str]					=						doctest.OutputChecker






class SCREAMING_SNAKE_CASE__					(		SCREAMING_SNAKE_CASE__   ):




    '''simple docstring'''






    def       _lowerCAmelCase (	self,		lowerCamelCase__,		lowerCamelCase__,		lowerCamelCase__		):
           if IGNORE_RESULT & optionflags:
                  return True
           return OutputChecker.check_output(self,		lowerCamelCase__,		lowerCamelCase__,		lowerCamelCase__		)


SCREAMING_SNAKE_CASE_:List[Any]					=						CustomOutputChecker
SCREAMING_SNAKE_CASE_:Tuple					=						HfDoctestModule




SCREAMING_SNAKE_CASE_:Optional[Any]					=						HfDocTestParser







from collections import OrderedDict
from typing import Mapping

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


SCREAMING_SNAKE_CASE_:int					=						logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_:Any					=						{
    """roberta-base""": """https://huggingface.co/roberta-base/resolve/main/config.json""",
    """roberta-large""": """https://huggingface.co/roberta-large/resolve/main/config.json""",
    """roberta-large-mnli""": """https://huggingface.co/roberta-large-mnli/resolve/main/config.json""",
    """distilroberta-base""": """https://huggingface.co/distilroberta-base/resolve/main/config.json""",
    """roberta-base-openai-detector""": """https://huggingface.co/roberta-base-openai-detector/resolve/main/config.json""",
    """roberta-large-openai-detector""": """https://huggingface.co/roberta-large-openai-detector/resolve/main/config.json""",
}






class SCREAMING_SNAKE_CASE__					(		SCREAMING_SNAKE_CASE__   ):




    '''simple docstring'''






    __lowerCamelCase      :			Any =				"roberta"






    def __init__(	self,		lowerCamelCase__=5_0265,		lowerCamelCase__=768,		lowerCamelCase__=12,		lowerCamelCase__=12,		lowerCamelCase__=3072,		lowerCamelCase__="gelu",		lowerCamelCase__=0.1,		lowerCamelCase__=0.1,		lowerCamelCase__=512,		lowerCamelCase__=2,		lowerCamelCase__=0.02,		lowerCamelCase__=1e-12,		lowerCamelCase__=1,		lowerCamelCase__=0,		lowerCamelCase__=2,		lowerCamelCase__="absolute",		lowerCamelCase__=True,		lowerCamelCase__=None,		**lowerCamelCase__,		):
        super().__init__(pad_token_id=lowerCamelCase__,		bos_token_id=lowerCamelCase__,		eos_token_id=lowerCamelCase__,		**lowerCamelCase__		)

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






class SCREAMING_SNAKE_CASE__					(		SCREAMING_SNAKE_CASE__   ):




    '''simple docstring'''






    @property
    def       _lowerCAmelCase (	self		):
        if self.task == "multiple-choice":
            A			:	Optional[Any]										=       {0: """batch""", 1: """choice""", 2: """sequence"""}
        else:
            A			:	int										=       {0: """batch""", 1: """sequence"""}
        return OrderedDict(
            [
                ("""input_ids""", dynamic_axis),
                ("""attention_mask""", dynamic_axis),
            ]		)


