



'''simple docstring'''



import argparse

from ...utils.dataclasses import (
    ComputeEnvironment,
    DistributedType,
    DynamoBackend,
    PrecisionType,
    SageMakerDistributedType,
)
from ..menu import BulletMenu


lowerCamelCase									=							[
    """EAGER""",
    """AOT_EAGER""",
    """INDUCTOR""",
    """NVFUSER""",
    """AOT_NVFUSER""",
    """AOT_CUDAGRAPHS""",
    """OFI""",
    """FX2TRT""",
    """ONNXRT""",
    """IPEX""",
]



def 	_A							( _lowerCAmelCase	, _lowerCAmelCase=None	, _lowerCAmelCase=None	, _lowerCAmelCase=None       ):



							"""simple docstring"""



							__lowercase													=True
							while ask_again:
														__lowercase													=input(_lowerCAmelCase       )
														try:
																					if default is not None and len(_lowerCAmelCase       ) == 0:
																												return default
																					return convert_value(_lowerCAmelCase       ) if convert_value is not None else result
														except Exception:
																					if error_message is not None:
																												print(_lowerCAmelCase       )



def 	_A							( _lowerCAmelCase	, _lowerCAmelCase=[]	, _lowerCAmelCase=None	, _lowerCAmelCase=0       ):



							"""simple docstring"""



							__lowercase													=BulletMenu(_lowerCAmelCase	, _lowerCAmelCase       )
							__lowercase													=menu.run(default_choice=_lowerCAmelCase       )
							return convert_value(_lowerCAmelCase       ) if convert_value is not None else result



def 	_A							( _lowerCAmelCase       ):



							"""simple docstring"""



							__lowercase													=int(_lowerCAmelCase       )
							return ComputeEnvironment(['LOCAL_MACHINE', 'AMAZON_SAGEMAKER'][value]       )



def 	_A							( _lowerCAmelCase       ):



							"""simple docstring"""



							__lowercase													=int(_lowerCAmelCase       )
							return DistributedType(['NO', 'MULTI_CPU', 'MULTI_XPU', 'MULTI_GPU', 'MULTI_NPU', 'TPU'][value]       )



def 	_A							( _lowerCAmelCase       ):



							"""simple docstring"""



							__lowercase													=int(_lowerCAmelCase       )
							return DynamoBackend(DYNAMO_BACKENDS[value]       ).value



def 	_A							( _lowerCAmelCase       ):



							"""simple docstring"""



							__lowercase													=int(_lowerCAmelCase       )
							return PrecisionType(['no', 'fp16', 'bf16', 'fp8'][value]       )



def 	_A							( _lowerCAmelCase       ):



							"""simple docstring"""



							__lowercase													=int(_lowerCAmelCase       )
							return SageMakerDistributedType(['NO', 'DATA_PARALLEL', 'MODEL_PARALLEL'][value]       )



def 	_A							( _lowerCAmelCase       ):



							"""simple docstring"""



							return {"yes": True, "no": False}[value.lower()]





class _UpperCamelCase		(  argparse.RawDescriptionHelpFormatter		):





				'''simple docstring'''





				def 					__lowerCamelCase  (				self	:	List[str]	,							_lowerCAmelCase	:	Any	,							_lowerCAmelCase	:	List[Any]	,							_lowerCAmelCase	:	Optional[int]	,							_lowerCAmelCase	:	Optional[Any]):







											'''simple docstring'''

											__lowercase													=super()._format_usage(lowercase_	,							lowercase_	,							lowercase_	,							lowercase_)
											__lowercase													=usage.replace('<command> [<args>] '	,							'')
											return usage





"""simple docstring"""

from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


SCREAMING_SNAKE_CASE_            =    {
    '''configuration_roc_bert''': ['''ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''RoCBertConfig'''],
    '''tokenization_roc_bert''': ['''RoCBertTokenizer'''],
}

try:
   if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   pass

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   SCREAMING_SNAKE_CASE_            =    [
       '''ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
       '''RoCBertForCausalLM''',
       '''RoCBertForMaskedLM''',
       '''RoCBertForMultipleChoice''',
       '''RoCBertForPreTraining''',
       '''RoCBertForQuestionAnswering''',
       '''RoCBertForSequenceClassification''',
       '''RoCBertForTokenClassification''',
       '''RoCBertLayer''',
       '''RoCBertModel''',
       '''RoCBertPreTrainedModel''',
       '''load_tf_weights_in_roc_bert''',
   ]

if TYPE_CHECKING:
   from .configuration_roc_bert import ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RoCBertConfig
   from .tokenization_roc_bert import RoCBertTokenizer

   try:
      if not is_tokenizers_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      raise OptionalDependencyNotAvailable()

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_roc_bert import (
          ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST,
          RoCBertForCausalLM,
          RoCBertForMaskedLM,
          RoCBertForMultipleChoice,
          RoCBertForPreTraining,
          RoCBertForQuestionAnswering,
          RoCBertForSequenceClassification,
          RoCBertForTokenClassification,
          RoCBertLayer,
          RoCBertModel,
          RoCBertPreTrainedModel,
          load_tf_weights_in_roc_bert,
      )


else:
   import sys

   SCREAMING_SNAKE_CASE_            =    _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)



