
"""simple docstring"""



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


a       :						Union[str, Any]       		=		logging.get_logger(__name__)

a       :						Tuple       		=		{
    '''google/switch-base-8''': '''https://huggingface.co/google/switch-base-8/blob/main/config.json''',
}




class 		a_    (			_UpperCAmelCase						):
    a   :					Union[str, Any]			     =					'switch_transformers'
    a   :					str			     =					['past_key_values']
    a   :					List[str]			     =					{'hidden_size': 'd_model', 'num_attention_heads': 'num_heads', 'num_hidden_layers': 'num_layers'}







    def __init__(      self      :							str  ,       __UpperCamelCase      :							Optional[int]=3_21_28  ,       __UpperCamelCase      :							List[Any]=7_68  ,       __UpperCamelCase      :							str=64  ,       __UpperCamelCase      :							Dict=20_48  ,       __UpperCamelCase      :							Any=64  ,       __UpperCamelCase      :							str=12  ,       __UpperCamelCase      :							Dict=3  ,       __UpperCamelCase      :							Tuple=12  ,       __UpperCamelCase      :							str=3  ,       __UpperCamelCase      :							List[Any]=12  ,       __UpperCamelCase      :							Union[str, Any]=8  ,       __UpperCamelCase      :							str=False  ,       __UpperCamelCase      :							Optional[int]=0.0_1  ,       __UpperCamelCase      :							Any="float32"  ,       __UpperCamelCase      :							str=False  ,       __UpperCamelCase      :							Tuple=32  ,       __UpperCamelCase      :							int=1_28  ,       __UpperCamelCase      :							Union[str, Any]=0.1  ,       __UpperCamelCase      :							Dict=1e-6  ,       __UpperCamelCase      :							List[str]=0.0_0_1  ,       __UpperCamelCase      :							List[Any]=0.0_0_1  ,       __UpperCamelCase      :							List[str]=1.0  ,       __UpperCamelCase      :							Any="relu"  ,       __UpperCamelCase      :							int=True  ,       __UpperCamelCase      :							Tuple=False  ,       __UpperCamelCase      :							Tuple=True  ,       __UpperCamelCase      :							Optional[int]=0  ,       __UpperCamelCase      :							List[str]=1  ,       **__UpperCamelCase      :							int  ,       )		->Optional[Any]:






        '''simple docstring'''






        _UpperCAmelCase        = vocab_size
        _UpperCAmelCase        = d_model
        _UpperCAmelCase        = d_kv
        _UpperCAmelCase        = d_ff

        _UpperCAmelCase        = num_sparse_encoder_layers

        _UpperCAmelCase        = num_layers
        _UpperCAmelCase        = (
            num_decoder_layers if num_decoder_layers is not None else self.num_layers
        )  # default = symmetry
        _UpperCAmelCase        = num_sparse_decoder_layers

        # This tells us, each how many encoder layer we'll have to set a sparse layer.
        if self.num_sparse_encoder_layers > 0:
            _UpperCAmelCase        = self.num_layers // self.num_sparse_encoder_layers
        else:
            _UpperCAmelCase        = self.num_layers  # HACK: this will create 0 sparse layers

        # This tells us, each how many encoder layer we'll have to set a sparse layer.
        if self.num_sparse_decoder_layers > 0:
            _UpperCAmelCase        = self.num_decoder_layers // self.num_sparse_decoder_layers
        else:
            _UpperCAmelCase        = self.num_decoder_layers  # HACK: this will create 0 sparse layers

        _UpperCAmelCase        = num_heads
        _UpperCAmelCase        = num_experts
        _UpperCAmelCase        = expert_capacity
        _UpperCAmelCase        = router_bias
        _UpperCAmelCase        = router_jitter_noise
        if router_dtype not in ["float32", "float16", "bfloat16"]:
            raise ValueError(f"""`router_dtype` must be one of 'float32', 'float16' or 'bfloat16', got {router_dtype}"""  )
        _UpperCAmelCase        = router_dtype

        _UpperCAmelCase        = router_ignore_padding_tokens
        _UpperCAmelCase        = relative_attention_num_buckets
        _UpperCAmelCase        = relative_attention_max_distance

        _UpperCAmelCase        = dropout_rate
        _UpperCAmelCase        = layer_norm_epsilon
        _UpperCAmelCase        = initializer_factor
        _UpperCAmelCase        = feed_forward_proj
        _UpperCAmelCase        = use_cache
        _UpperCAmelCase        = add_router_probs

        _UpperCAmelCase        = router_z_loss_coef
        _UpperCAmelCase        = router_aux_loss_coef

        _UpperCAmelCase        = self.feed_forward_proj.split("""-"""  )
        _UpperCAmelCase        = act_info[-1]
        _UpperCAmelCase        = 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":
            _UpperCAmelCase        = """gelu_new"""

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

"""simple docstring"""



import os
from math import logaa


def 			_UpperCamelCase						(    _A = "base_exp.txt"   )     ->	int:





    """simple docstring"""

    _UpperCAmelCase        = 0
    _UpperCAmelCase        = 0
    for i, line in enumerate(open(os.path.join(os.path.dirname(_A   )       ,   _A   )   )   ):
        _UpperCAmelCase     ,_UpperCAmelCase        = list(map(_A       ,   line.split(""","""   )   )   )
        if x * logaa(_A   ) > largest:
            _UpperCAmelCase        = x * logaa(_A   )
            _UpperCAmelCase        = i + 1
    return result


if __name__ == "__main__":
 print(solution())