"""simple docstring"""







from typing import Mapping

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


__SCREAMING_SNAKE_CASE								=logging.get_logger(__name__)

__SCREAMING_SNAKE_CASE								={
    "t5-small": "https://huggingface.co/t5-small/resolve/main/config.json",
    "t5-base": "https://huggingface.co/t5-base/resolve/main/config.json",
    "t5-large": "https://huggingface.co/t5-large/resolve/main/config.json",
    "t5-3b": "https://huggingface.co/t5-3b/resolve/main/config.json",
    "t5-11b": "https://huggingface.co/t5-11b/resolve/main/config.json",
}







class  UpperCamelCase	(    lowercase_						):
   lowercase							=						't5'
   lowercase							=						['past_key_values']
   lowercase							=						{'hidden_size': 'd_model', 'num_attention_heads': 'num_heads', 'num_hidden_layers': 'num_layers'}
   def __init__(    self  ,__UpperCamelCase=3_2128  ,__UpperCamelCase=512  ,__UpperCamelCase=64  ,__UpperCamelCase=2048  ,__UpperCamelCase=6  ,__UpperCamelCase=None  ,__UpperCamelCase=8  ,__UpperCamelCase=32  ,__UpperCamelCase=128  ,__UpperCamelCase=0.1  ,__UpperCamelCase=1e-6  ,__UpperCamelCase=1.0  ,__UpperCamelCase="relu"  ,__UpperCamelCase=True  ,__UpperCamelCase=True  ,__UpperCamelCase=0  ,__UpperCamelCase=1  ,**__UpperCamelCase  ,)			->   str:


          '''simple docstring'''


          lowercase_			:       Any									=			vocab_size
          lowercase_			:       Tuple									=			d_model
          lowercase_			:       List[Any]									=			d_kv
          lowercase_			:       List[Any]									=			d_ff
          lowercase_			:       List[Any]									=			num_layers
          lowercase_			:       Optional[Any]									=			(
              num_decoder_layers if num_decoder_layers is not None else self.num_layers
          )  # default = symmetry
          lowercase_			:       List[Any]									=			num_heads
          lowercase_			:       int									=			relative_attention_num_buckets
          lowercase_			:       Tuple									=			relative_attention_max_distance
          lowercase_			:       List[Any]									=			dropout_rate
          lowercase_			:       Optional[int]									=			layer_norm_epsilon
          lowercase_			:       Tuple									=			initializer_factor
          lowercase_			:       Union[str, Any]									=			feed_forward_proj
          lowercase_			:       List[Any]									=			use_cache

          lowercase_			:       List[str]									=			self.feed_forward_proj.split('-'    )
          lowercase_			:       Optional[Any]									=			act_info[-1]
          lowercase_			:       int									=			act_info[0] == 'gated'

          if len(__UpperCamelCase    ) > 1 and act_info[0] != "gated" or len(__UpperCamelCase    ) > 2:
                 raise ValueError(
                     f'''`feed_forward_proj`: {feed_forward_proj} is not a valid activation function of the dense layer.'''
                     'Please make sure `feed_forward_proj` is of the format `gated-{ACT_FN}` or `{ACT_FN}`, e.g. '
                     '\'gated-gelu\' or \'relu\''    )

          # for backwards compatibility
          if feed_forward_proj == "gated-gelu":
                 lowercase_			:       Tuple									=			'gelu_new'

          super().__init__(
              pad_token_id=__UpperCamelCase  ,eos_token_id=__UpperCamelCase  ,is_encoder_decoder=__UpperCamelCase  ,**__UpperCamelCase  ,)







class  UpperCamelCase	(    lowercase_						):
   @property
   def     _UpperCAmelCase     (    self    )			->   Mapping[str, Mapping[int, str]]:


          '''simple docstring'''


          lowercase_			:       Union[str, Any]									=			{
              'input_ids': {0: 'batch', 1: 'encoder_sequence'},
              'attention_mask': {0: 'batch', 1: 'encoder_sequence'},
          }
          if self.use_past:
                 lowercase_			:       Any									=			'past_encoder_sequence + sequence'
                 lowercase_			:       List[str]									=			{0: 'batch'}
                 lowercase_			:       Dict									=			{0: 'batch', 1: 'past_decoder_sequence + sequence'}
          else:
                 lowercase_			:       Union[str, Any]									=			{0: 'batch', 1: 'decoder_sequence'}
                 lowercase_			:       List[str]									=			{0: 'batch', 1: 'decoder_sequence'}

          if self.use_past:
                 self.fill_with_past_key_values_(__UpperCamelCase  ,direction='inputs'    )

          return common_inputs







   @property
   def     _UpperCAmelCase     (    self    )			->   int:


          '''simple docstring'''


          return 13


"""simple docstring"""







# Lint as: python3
# pylint: enable=line-too-long
# pylint: disable=g-import-not-at-top,g-bad-import-order,wrong-import-position

__SCREAMING_SNAKE_CASE								="2.13.1"

import platform

import pyarrow
from packaging import version


if version.parse(platform.python_version()) < version.parse("3.7"):
       raise ImportWarning(
           "To use `datasets`, Python>=3.7 is required, and the current version of Python doesn't match this condition."
       )

if version.parse(pyarrow.__version__).major < 8:
       raise ImportWarning(
           "To use `datasets`, the module `pyarrow>=8.0.0` is required, and the current version of `pyarrow` doesn't match this condition.\n"
           "If you are running this in a Google Colab, you should probably just restart the runtime to use the right version of `pyarrow`."
       )

del platform
del pyarrow
del version

from .arrow_dataset import Dataset
from .arrow_reader import ReadInstruction
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
from .combine import concatenate_datasets, interleave_datasets
from .dataset_dict import DatasetDict, IterableDatasetDict
from .download import *
from .features import *
from .fingerprint import disable_caching, enable_caching, is_caching_enabled, set_caching_enabled
from .info import DatasetInfo, MetricInfo
from .inspect import (
    get_dataset_config_info,
    get_dataset_config_names,
    get_dataset_infos,
    get_dataset_split_names,
    inspect_dataset,
    inspect_metric,
    list_datasets,
    list_metrics,
)
from .iterable_dataset import IterableDataset
from .load import load_dataset, load_dataset_builder, load_from_disk, load_metric
from .metric import Metric
from .splits import (
    NamedSplit,
    NamedSplitAll,
    Split,
    SplitBase,
    SplitDict,
    SplitGenerator,
    SplitInfo,
    SubSplitInfo,
    percent,
)
from .tasks import *
from .utils import *
from .utils import logging


# deprecated modules
from datasets import arrow_dataset as _arrow_dataset  # isort:skip
from datasets import utils as _utils  # isort:skip
from datasets.utils import download_manager as _deprecated_download_manager  # isort:skip

__SCREAMING_SNAKE_CASE								=concatenate_datasets
__SCREAMING_SNAKE_CASE								=DownloadConfig
__SCREAMING_SNAKE_CASE								=DownloadManager
__SCREAMING_SNAKE_CASE								=DownloadMode
__SCREAMING_SNAKE_CASE								=DownloadConfig
__SCREAMING_SNAKE_CASE								=DownloadMode
__SCREAMING_SNAKE_CASE								=DownloadManager

del _arrow_dataset, _utils, _deprecated_download_manager

