






'''simple docstring'''



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


SCREAMING_SNAKE_CASE						=	logging.getLogger(__name__)
@dataclass
@add_start_docstrings(TrainingArguments.__doc__				)
class UpperCAmelCase_					(    __A				):




     """simple docstring"""




     UpperCamelCase_								=			field(default=__A				,       metadata={'''help''': '''Whether to use SortishSampler or not.'''}				)
     UpperCamelCase_								=			field(
         default=__A				,       metadata={'''help''': '''Whether to use generate to calculate generative metrics (ROUGE, BLEU).'''}				)
     UpperCamelCase_								=			field(
         default=__A				,       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.'''
             )
         }				,       )
     UpperCamelCase_								=			field(
         default=__A				,       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.'''
             )
         }				,       )
     UpperCamelCase_								=			field(
         default=__A				,       metadata={
             '''help''': '''Model id, file path or url pointing to a GenerationConfig json file, to use during prediction.'''
         }				,       )






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


      '''simple docstring'''

      lowercase					:   Union[str, Any]				  =super().to_dict()
      for k, v in d.items():
       if isinstance(UpperCAmelCase     ,      UpperCAmelCase		):
        lowercase					:   List[str]				  =v.to_dict()
      return d











'''simple docstring'''



from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


SCREAMING_SNAKE_CASE						=	{
    'configuration_mega': ['MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MegaConfig', 'MegaOnnxConfig'],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      SCREAMING_SNAKE_CASE						=	[
          'MEGA_PRETRAINED_MODEL_ARCHIVE_LIST',
          'MegaForCausalLM',
          'MegaForMaskedLM',
          'MegaForMultipleChoice',
          'MegaForQuestionAnswering',
          'MegaForSequenceClassification',
          'MegaForTokenClassification',
          'MegaModel',
          'MegaPreTrainedModel',
      ]

if TYPE_CHECKING:
      from .configuration_mega import MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP, MegaConfig, MegaOnnxConfig

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_mega import (
                MEGA_PRETRAINED_MODEL_ARCHIVE_LIST,
                MegaForCausalLM,
                MegaForMaskedLM,
                MegaForMultipleChoice,
                MegaForQuestionAnswering,
                MegaForSequenceClassification,
                MegaForTokenClassification,
                MegaModel,
                MegaPreTrainedModel,
            )

else:
      import sys

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



