





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


snake_case__					:							Tuple													=     logging.get_logger(__name__)

snake_case__					:							Optional[int]													=     {
    'google/switch-base-8': 'https://huggingface.co/google/switch-base-8/blob/main/config.json',
}





class A_					(			_lowerCamelCase   ):
   lowerCAmelCase__        = """switch_transformers"""
   lowerCAmelCase__        = ["""past_key_values"""]
   lowerCAmelCase__        = {"""hidden_size""": """d_model""", """num_attention_heads""": """num_heads""", """num_hidden_layers""": """num_layers"""}




   def __init__(self	:List[str]    ,   _UpperCamelCase	:List[Any]=3_2128    ,   _UpperCamelCase	:Optional[Any]=768    ,   _UpperCamelCase	:Union[str, Any]=64    ,   _UpperCamelCase	:Optional[int]=2048    ,   _UpperCamelCase	:Union[str, Any]=64    ,   _UpperCamelCase	:str=12    ,   _UpperCamelCase	:Tuple=3    ,   _UpperCamelCase	:Optional[Any]=12    ,   _UpperCamelCase	:int=3    ,   _UpperCamelCase	:Tuple=12    ,   _UpperCamelCase	:str=8    ,   _UpperCamelCase	:List[str]=False    ,   _UpperCamelCase	:Optional[Any]=0.0_1    ,   _UpperCamelCase	:List[Any]="float32"    ,   _UpperCamelCase	:List[Any]=False    ,   _UpperCamelCase	:Optional[Any]=32    ,   _UpperCamelCase	:Dict=128    ,   _UpperCamelCase	:str=0.1    ,   _UpperCamelCase	:List[str]=1e-6    ,   _UpperCamelCase	:Optional[int]=0.0_0_1    ,   _UpperCamelCase	:Optional[Any]=0.0_0_1    ,   _UpperCamelCase	:List[str]=1.0    ,   _UpperCamelCase	:Any="relu"    ,   _UpperCamelCase	:int=True    ,   _UpperCamelCase	:Tuple=False    ,   _UpperCamelCase	:Dict=True    ,   _UpperCamelCase	:str=0    ,   _UpperCamelCase	:Optional[int]=1    ,   **_UpperCamelCase	:str    ,   )->					Optional[int]:
         __A          =				vocab_size
         __A          =				d_model
         __A          =				d_kv
         __A          =				d_ff

         __A          =				num_sparse_encoder_layers

         __A          =				num_layers
         __A          =				(
             num_decoder_layers if num_decoder_layers is not None else self.num_layers
         )  # default = symmetry
         __A          =				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:
               __A          =				self.num_layers // self.num_sparse_encoder_layers
         else:
               __A          =				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:
               __A          =				self.num_decoder_layers // self.num_sparse_decoder_layers
         else:
               __A          =				self.num_decoder_layers  # HACK: this will create 0 sparse layers

         __A          =				num_heads
         __A          =				num_experts
         __A          =				expert_capacity
         __A          =				router_bias
         __A          =				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}""" )
         __A          =				router_dtype

         __A          =				router_ignore_padding_tokens
         __A          =				relative_attention_num_buckets
         __A          =				relative_attention_max_distance

         __A          =				dropout_rate
         __A          =				layer_norm_epsilon
         __A          =				initializer_factor
         __A          =				feed_forward_proj
         __A          =				use_cache
         __A          =				add_router_probs

         __A          =				router_z_loss_coef
         __A          =				router_aux_loss_coef

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

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












import os
from datetime import datetime as dt

from github import Github


snake_case__					:							Union[str, Any]													=     [
    'good first issue',
    'feature request',
    'wip',
]



def _a				(	)	->						List[Any]:







      '''simple docstring'''






      __A          =				Github(os.environ['''GITHUB_TOKEN'''] )
      __A          =				g.get_repo('''huggingface/accelerate''' )
      __A          =				repo.get_issues(state='''open''' )

      for issue in open_issues:
            __A          =				sorted([comment for comment in issue.get_comments()]					,				key=lambda lowerCamelCase : i.created_at					,				reverse=lowerCamelCase )
            __A          =				comments[0] if len(lowerCamelCase ) > 0 else None
            __A          =				dt.utcnow()
            __A          =				(current_time - issue.updated_at).days
            __A          =				(current_time - issue.created_at).days
            if (
                last_comment is not None
                and last_comment.user.login == "github-actions[bot]"
                and days_since_updated > 7
                and days_since_creation >= 30
                and not any(label.name.lower() in LABELS_TO_EXEMPT for label in issue.get_labels() )
            ):
                  # Close issue since it has been 7 days of inactivity since bot mention.
                  issue.edit(state='''closed''' )
            elif (
                days_since_updated > 23
                and days_since_creation >= 30
                and not any(label.name.lower() in LABELS_TO_EXEMPT for label in issue.get_labels() )
            ):
                  # Add stale comment
                  issue.create_comment(
                      '''This issue has been automatically marked as stale because it has not had '''
                      '''recent activity. If you think this still needs to be addressed '''
                      '''please comment on this thread.\n\nPlease note that issues that do not follow the '''
                      '''[contributing guidelines](https://github.com/huggingface/accelerate/blob/main/CONTRIBUTING.md) '''
                      '''are likely to be ignored.''' )


if __name__ == "__main__":
       main()





