



"""simple docstring"""
from ...configuration_utils import PretrainedConfig
from ...utils import logging


__a           =							logging.get_logger(__name__)

__a           =							{
    "facebook/opt-125m": "https://huggingface.co/facebook/opt-125m/blob/main/config.json",
    "facebook/opt-350m": "https://huggingface.co/facebook/opt-350m/blob/main/config.json",
    "facebook/opt-1.3b": "https://huggingface.co/facebook/opt-1.3b/blob/main/config.json",
    "facebook/opt-2.7b": "https://huggingface.co/facebook/opt-2.7b/blob/main/config.json",
    "facebook/opt-6.7b": "https://huggingface.co/facebook/opt-6.7b/blob/main/config.json",
    "facebook/opt-13b": "https://huggingface.co/facebook/opt-13b/blob/main/config.json",
}
class 							lowerCamelCase    (     _lowerCAmelCase							):






					'''simple docstring'''





					_A						:     Dict		=	"""opt"""
					_A						:     Optional[Any]		=	["""past_key_values"""]






					def __init__(			self:				Optional[int]		,	snake_case:				Optional[Any]=50_272		,	snake_case:				Tuple=768		,	snake_case:				Union[str, Any]=12		,	snake_case:				List[Any]=3_072		,	snake_case:				Optional[Any]=2_048		,	snake_case:				Dict=True		,	snake_case:				int=False		,	snake_case:				List[str]=None		,	snake_case:				Any=0.1		,	snake_case:				int=0.0		,	snake_case:				Tuple=12		,	snake_case:				Any="relu"		,	snake_case:				Tuple=0.0		,	snake_case:				str=0.0_2		,	snake_case:				int=True		,	snake_case:				Dict=1		,	snake_case:				Optional[Any]=2		,	snake_case:				Tuple=2		,	snake_case:				Optional[int]=True		,	snake_case:				Optional[Any]=True		,	**snake_case:				Optional[int]		,	)  ->      List[Any]:
											super().__init__(
											    pad_token_id=snake_case		,	bos_token_id=snake_case		,	eos_token_id=snake_case		,	**snake_case		,	)
											snake_case_					:Optional[int]		=     vocab_size
											snake_case_					:int		=     max_position_embeddings
											snake_case_					:Optional[int]		=     num_attention_heads
											snake_case_					:Tuple		=     word_embed_proj_dim if word_embed_proj_dim is not None else hidden_size
											snake_case_					:Tuple		=     ffn_dim
											snake_case_					:Optional[int]		=     hidden_size
											snake_case_					:int		=     num_hidden_layers
											snake_case_					:int		=     dropout
											snake_case_					:Optional[Any]		=     attention_dropout
											snake_case_					:int		=     activation_function
											snake_case_					:str		=     init_std
											snake_case_					:Optional[Any]		=     layerdrop
											snake_case_					:List[Any]		=     use_cache
											snake_case_					:Any		=     do_layer_norm_before
											# We keep these variables at `True` for backward compatibility.
											snake_case_					:List[Any]		=     enable_bias
											snake_case_					:List[str]		=     layer_norm_elementwise_affine

											# Note that the only purpose of `_remove_final_layer_norm` is to keep backward compatibility
											# with checkpoints that have been fine-tuned before transformers v4.20.1
											# see https://github.com/facebookresearch/metaseq/pull/164
											snake_case_					:Optional[Any]		=     _remove_final_layer_norm


"""simple docstring"""





import math
from timeit import timeit







def       __a	(						__lowerCamelCase    ):
   UpperCAmelCase_   :   Tuple     	=       0
   UpperCAmelCase_   :   Any     	=       abs(__lowerCamelCase    )
   while True:
      UpperCAmelCase_   :   Optional[int]     	=       n // 10
      digits += 1
      if n == 0:
         break
   return digits







def       __a	(						__lowerCamelCase    ):
   return 1 if n == 0 else math.floor(math.log(abs(__lowerCamelCase    ),						10    ) + 1    )







def       __a	(						__lowerCamelCase    ):
   return len(str(abs(__lowerCamelCase    )    )    )







def       __a	(						):
   from collections.abc import Callable

   def benchmark_a_function(__lowerCamelCase,						__lowerCamelCase    ) -> None:
      UpperCAmelCase_   :   Optional[Any]     	=       f"""{func.__name__}({value})"""
      UpperCAmelCase_   :   Optional[int]     	=       timeit(f"""__main__.{call}""",						setup="import __main__"    )
      print(f"""{call}: {func(__lowerCamelCase    )} -- {timing} seconds"""    )

   for value in (26_2144, 1125_8999_0684_2624, 126_7650_6002_2822_9401_4967_0320_5376):
      for func in (num_digits, num_digits_fast, num_digits_faster):
         benchmark_a_function(__lowerCamelCase,						__lowerCamelCase    )
      print()


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    benchmark()


