


'''simple docstring'''







from typing import List, Union

from ...configuration_utils import PretrainedConfig
from ...utils import logging


a__    :   Optional[int]								=			logging.get_logger(__name__)

a__    :   Optional[int]								=			{
    'allenai/led-base-16384': 'https://huggingface.co/allenai/led-base-16384/resolve/main/config.json',
    # See all LED models at https://huggingface.co/models?filter=led
}
class    lowercase_	(       a__  ):
    __UpperCAmelCase       =      'led'
    __UpperCAmelCase       =      {
        'num_attention_heads': 'encoder_attention_heads',
        'hidden_size': 'd_model',
        'attention_probs_dropout_prob': 'attention_dropout',
        'initializer_range': 'init_std',
    }


    def __init__(	self    ,   a=5_02_65    ,   a=1_63_84    ,   a=10_24    ,   a=12    ,   a=40_96    ,   a=16    ,   a=12    ,   a=40_96    ,   a=16    ,   a=0.0    ,   a=0.0    ,   a=True    ,   a=True    ,   a="gelu"    ,   a=10_24    ,   a=0.1    ,   a=0.0    ,   a=0.0    ,   a=0.02    ,   a=2    ,   a=0.0    ,   a=1    ,   a=0    ,   a=2    ,   a = 5_12    ,   **a    ,   ):
          UpperCamelCase__      =							vocab_size
          UpperCamelCase__      =							max_encoder_position_embeddings
          UpperCamelCase__      =							max_decoder_position_embeddings
          UpperCamelCase__      =							d_model
          UpperCamelCase__      =							encoder_ffn_dim
          UpperCamelCase__      =							encoder_layers
          UpperCamelCase__      =							encoder_attention_heads
          UpperCamelCase__      =							decoder_ffn_dim
          UpperCamelCase__      =							decoder_layers
          UpperCamelCase__      =							decoder_attention_heads
          UpperCamelCase__      =							dropout
          UpperCamelCase__      =							attention_dropout
          UpperCamelCase__      =							activation_dropout
          UpperCamelCase__      =							activation_function
          UpperCamelCase__      =							init_std
          UpperCamelCase__      =							encoder_layerdrop
          UpperCamelCase__      =							decoder_layerdrop
          UpperCamelCase__      =							classifier_dropout
          UpperCamelCase__      =							use_cache
          UpperCamelCase__      =							encoder_layers
          UpperCamelCase__      =							attention_window

          super().__init__(
              pad_token_id=a    ,   bos_token_id=a    ,   eos_token_id=a    ,   is_encoder_decoder=a    ,   decoder_start_token_id=a    ,   **a    ,   )









'''simple docstring'''







import math
from timeit import timeit







def _UpperCamelCase			(	__A       )				->						int:


      '''simple docstring'''



      UpperCamelCase__      =							0
      UpperCamelCase__      =							abs(__A       )
      while True:
            UpperCamelCase__      =							n // 10
            digits += 1
            if n == 0:
                  break
      return digits







def _UpperCamelCase			(	__A       )				->						int:


      '''simple docstring'''



      return 1 if n == 0 else math.floor(math.log(abs(__A       ) ,     10       ) + 1       )







def _UpperCamelCase			(	__A       )				->						int:


      '''simple docstring'''



      return len(str(abs(__A       )       )       )







def _UpperCamelCase			(	)				->						None:


      '''simple docstring'''



      from collections.abc import Callable

      def benchmark_a_function(__A ,     __A       ) -> None:
            UpperCamelCase__      =							F'''{func.__name__}({value})'''
            UpperCamelCase__      =							timeit(F'''__main__.{call}''' ,     setup="import __main__"       )
            print(F'''{call}: {func(__A       )} -- {timing} seconds'''       )

      for value in (262144, 1125899906842624, 1267650600228229401496703205376):
            for func in (num_digits, num_digits_fast, num_digits_faster):
                  benchmark_a_function(__A ,     __A       )
            print()


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  benchmark()





