





import os
from distutils.util import strtobool




def     a__ (					lowercase__  ,    lowercase__  ):






   '''simple docstring'''






   for e in env_keys:
      UpperCAmelCase_											=int(os.environ.get(lowercase__  ,    -1  )  )
      if val >= 0:
         return val
   return default




def     a__ (					lowercase__  ,    lowercase__=False  ):






   '''simple docstring'''






   UpperCAmelCase_											=os.environ.get(lowercase__  ,    str(lowercase__  )  )
   return strtobool(lowercase__  ) == 1  # As its name indicates `strtobool` actually returns an int...






def     a__ (					lowercase__  ,    lowercase__="no"  ):






   '''simple docstring'''






   UpperCAmelCase_											=os.environ.get(lowercase__  ,    str(lowercase__  )  )
   return value











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


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

__lowercase  :   List[Any]						      ={
    """tanreinama/GPTSAN-2.8B-spout_is_uniform""": (
        """https://huggingface.co/tanreinama/GPTSAN-2.8B-spout_is_uniform/resolve/main/config.json"""
    ),
}

class      A       (	__lowercase						):
      _snake_case							     ='''gptsan-japanese'''
      _snake_case							     =[
          '''past_key_values''',
      ]
      _snake_case							     ={
          '''hidden_size''': '''d_model''',
          '''num_attention_heads''': '''num_heads''',
          '''num_hidden_layers''': '''num_layers''',
      }



      def __init__(	self:						Optional[Any]		,  _lowerCAmelCase:						List[Any]=3_6000		,  _lowerCAmelCase:						List[Any]=1280		,  _lowerCAmelCase:						str=1024		,  _lowerCAmelCase:						Any=8192		,  _lowerCAmelCase:						str=4096		,  _lowerCAmelCase:						int=128		,  _lowerCAmelCase:						int=10		,  _lowerCAmelCase:						Dict=0		,  _lowerCAmelCase:						Any=16		,  _lowerCAmelCase:						Optional[int]=16		,  _lowerCAmelCase:						List[Any]=128		,  _lowerCAmelCase:						Tuple=0.0		,  _lowerCAmelCase:						Optional[Any]=1e-5		,  _lowerCAmelCase:						int=False		,  _lowerCAmelCase:						Optional[Any]=0.0		,  _lowerCAmelCase:						str="float32"		,  _lowerCAmelCase:						Dict=False		,  _lowerCAmelCase:						Any=False		,  _lowerCAmelCase:						int=False		,  _lowerCAmelCase:						Union[str, Any]=0.0_02		,  _lowerCAmelCase:						Optional[int]=False		,  _lowerCAmelCase:						int=True		,  _lowerCAmelCase:						List[str]=3_5998		,  _lowerCAmelCase:						Optional[int]=3_5995		,  _lowerCAmelCase:						Dict=3_5999		,  **_lowerCAmelCase:						Optional[Any]		,  )						->    List[Any]:
         '''simple docstring'''

         UpperCAmelCase_											=vocab_size
         UpperCAmelCase_											=max_position_embeddings
         UpperCAmelCase_											=d_model
         UpperCAmelCase_											=d_ff
         UpperCAmelCase_											=d_ext
         UpperCAmelCase_											=d_spout
         UpperCAmelCase_											=num_switch_layers
         UpperCAmelCase_											=num_ext_layers
         UpperCAmelCase_											=num_switch_layers + num_ext_layers
         UpperCAmelCase_											=num_heads
         UpperCAmelCase_											=num_experts
         UpperCAmelCase_											=expert_capacity
         UpperCAmelCase_											=dropout_rate
         UpperCAmelCase_											=layer_norm_epsilon
         UpperCAmelCase_											=router_bias
         UpperCAmelCase_											=router_jitter_noise
         UpperCAmelCase_											=router_dtype
         UpperCAmelCase_											=router_ignore_padding_tokens
         UpperCAmelCase_											=output_hidden_states
         UpperCAmelCase_											=output_attentions
         UpperCAmelCase_											=initializer_factor
         UpperCAmelCase_											=output_router_logits
         UpperCAmelCase_											=use_cache

         super().__init__(
             separator_token_id=_lowerCAmelCase		,  pad_token_id=_lowerCAmelCase		,  eos_token_id=_lowerCAmelCase		,  **_lowerCAmelCase		,  )




