





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


UpperCAmelCase_  							=				{
    'configuration_electra': ['ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP', 'ElectraConfig', 'ElectraOnnxConfig'],
    'tokenization_electra': ['ElectraTokenizer'],
}

try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase_  							=				['ElectraTokenizerFast']

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase_  							=				[
      'ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST',
      'ElectraForCausalLM',
      'ElectraForMaskedLM',
      'ElectraForMultipleChoice',
      'ElectraForPreTraining',
      'ElectraForQuestionAnswering',
      'ElectraForSequenceClassification',
      'ElectraForTokenClassification',
      'ElectraModel',
      'ElectraPreTrainedModel',
      'load_tf_weights_in_electra',
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase_  							=				[
      'TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST',
      'TFElectraForMaskedLM',
      'TFElectraForMultipleChoice',
      'TFElectraForPreTraining',
      'TFElectraForQuestionAnswering',
      'TFElectraForSequenceClassification',
      'TFElectraForTokenClassification',
      'TFElectraModel',
      'TFElectraPreTrainedModel',
  ]

try:
  if not is_flax_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase_  							=				[
      'FlaxElectraForCausalLM',
      'FlaxElectraForMaskedLM',
      'FlaxElectraForMultipleChoice',
      'FlaxElectraForPreTraining',
      'FlaxElectraForQuestionAnswering',
      'FlaxElectraForSequenceClassification',
      'FlaxElectraForTokenClassification',
      'FlaxElectraModel',
      'FlaxElectraPreTrainedModel',
  ]


if TYPE_CHECKING:
  from .configuration_electra import ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP, ElectraConfig, ElectraOnnxConfig
  from .tokenization_electra import ElectraTokenizer

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_electra_fast import ElectraTokenizerFast

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_electra import (
        ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST,
        ElectraForCausalLM,
        ElectraForMaskedLM,
        ElectraForMultipleChoice,
        ElectraForPreTraining,
        ElectraForQuestionAnswering,
        ElectraForSequenceClassification,
        ElectraForTokenClassification,
        ElectraModel,
        ElectraPreTrainedModel,
        load_tf_weights_in_electra,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_electra import (
        TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST,
        TFElectraForMaskedLM,
        TFElectraForMultipleChoice,
        TFElectraForPreTraining,
        TFElectraForQuestionAnswering,
        TFElectraForSequenceClassification,
        TFElectraForTokenClassification,
        TFElectraModel,
        TFElectraPreTrainedModel,
    )

  try:
    if not is_flax_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_flax_electra import (
        FlaxElectraForCausalLM,
        FlaxElectraForMaskedLM,
        FlaxElectraForMultipleChoice,
        FlaxElectraForPreTraining,
        FlaxElectraForQuestionAnswering,
        FlaxElectraForSequenceClassification,
        FlaxElectraForTokenClassification,
        FlaxElectraModel,
        FlaxElectraPreTrainedModel,
    )

else:
  import sys

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








import logging
from dataclasses import dataclass, field
from pathlib import Path
from typing import Optional, Union

from .generation.configuration_utils import GenerationConfig
from .training_args import TrainingArguments
from .utils import add_start_docstrings


UpperCAmelCase_  							=				logging.getLogger(__name__)






@dataclass
@add_start_docstrings(TrainingArguments.__doc__       )
class 					lowercase__ (			__lowerCamelCase       ):

   '''simple docstring'''


   a		:							bool     	=	field(default=__lowerCamelCase    ,       metadata={"help": "Whether to use SortishSampler or not."}       )
   a		:							bool     	=	field(
       default=__lowerCamelCase    ,       metadata={"help": "Whether to use generate to calculate generative metrics (ROUGE, BLEU)."}       )
   a		:							Optional[int]     	=	field(
       default=__lowerCamelCase    ,       metadata={
           "help": (
               "The `max_length` to use on each evaluation loop when `predict_with_generate=True`. Will default "
               "to the `max_length` value of the model configuration."
           )
       }    ,       )
   a		:							Optional[int]     	=	field(
       default=__lowerCamelCase    ,       metadata={
           "help": (
               "The `num_beams` to use on each evaluation loop when `predict_with_generate=True`. Will default "
               "to the `num_beams` value of the model configuration."
           )
       }    ,       )
   a		:							Optional[Union[str, Path, GenerationConfig]]     	=	field(
       default=__lowerCamelCase    ,       metadata={
           "help": "Model id, file path or url pointing to a GenerationConfig json file, to use during prediction."
       }    ,       )




   def    UpperCamelCase__						(					self							)				->   str:






       """simple docstring"""
       UpperCamelCase__							:       Tuple      =   super().to_dict()
       for k, v in d.items():
           if isinstance(__magic_name__,	__magic_name__							):
               UpperCamelCase__							:       Tuple      =   v.to_dict()
       return d

