




from datetime import datetime as dt
import os

from github import Github


lowerCamelCase__			:       List[str]         =							[
    "good first issue",
    "good second issue",
    "good difficult issue",
    "feature request",
    "new model",
    "wip",
]

def  UpperCAmelCase_							(				) ->			int:
      SCREAMING_SNAKE_CASE_     						=      Github(os.environ['GITHUB_TOKEN']							)
      SCREAMING_SNAKE_CASE_     						=      g.get_repo('huggingface/transformers'							)
      SCREAMING_SNAKE_CASE_     						=      repo.get_issues(state='open'							)

      for issue in open_issues:
            SCREAMING_SNAKE_CASE_     						=      sorted([comment for comment in issue.get_comments()]      ,      key=lambda _lowercase							: i.created_at      ,      reverse=_snake_case							)
            SCREAMING_SNAKE_CASE_     						=      comments[0] if len(_snake_case							) > 0 else None
            if (
                last_comment is not None
                and last_comment.user.login == "github-actions[bot]"
                and (dt.utcnow() - issue.updated_at).days > 7
                and (dt.utcnow() - issue.created_at).days >= 30
                and not any(label.name.lower() in LABELS_TO_EXEMPT for label in issue.get_labels()							)
            ):
                  # print(f"Would close issue {issue.number} since it has been 7 days of inactivity since bot mention.")
                  issue.edit(state='closed'							)
            elif (
                (dt.utcnow() - issue.updated_at).days > 23
                and (dt.utcnow() - issue.created_at).days >= 30
                and not any(label.name.lower() in LABELS_TO_EXEMPT for label in issue.get_labels()							)
            ):
                  # print(f"Would add stale comment to {issue.number}")
                  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/transformers/blob/main/CONTRIBUTING.md) '
                      'are likely to be ignored.'							)


if __name__ == "__main__":
   main()





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


lowerCamelCase__			:       Dict         =							logging.get_logger(__name__)

lowerCamelCase__			:       Any         =							{
    'facebook/s2t-small-librispeech-asr': (
        'https://huggingface.co/facebook/s2t-small-librispeech-asr/resolve/main/config.json'
    ),
    # See all Speech2Text models at https://huggingface.co/models?filter=speech_to_text
}





class 	lowerCamelCase_							(				_SCREAMING_SNAKE_CASE ):


 '''simple docstring'''







 lowercase_       =   "speech_to_text"
 lowercase_       =   ["past_key_values"]
 lowercase_       =   {"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}



 def __init__(							self  :		Union[str, Any]    ,    _lowerCAmelCase  :		Optional[int]=10_000    ,    _lowerCAmelCase  :		str=12    ,    _lowerCAmelCase  :		Tuple=2_048    ,    _lowerCAmelCase  :		str=4    ,    _lowerCAmelCase  :		Tuple=6    ,    _lowerCAmelCase  :		Optional[int]=2_048    ,    _lowerCAmelCase  :		Dict=4    ,    _lowerCAmelCase  :		List[Any]=0.0    ,    _lowerCAmelCase  :		int=0.0    ,    _lowerCAmelCase  :		Optional[int]=True    ,    _lowerCAmelCase  :		Union[str, Any]=True    ,    _lowerCAmelCase  :		Any="relu"    ,    _lowerCAmelCase  :		Any=256    ,    _lowerCAmelCase  :		List[str]=0.1    ,    _lowerCAmelCase  :		Optional[Any]=0.0    ,    _lowerCAmelCase  :		Optional[int]=0.0    ,    _lowerCAmelCase  :		Tuple=0.02    ,    _lowerCAmelCase  :		List[str]=2    ,    _lowerCAmelCase  :		Tuple=True    ,    _lowerCAmelCase  :		List[str]=1    ,    _lowerCAmelCase  :		Dict=0    ,    _lowerCAmelCase  :		Tuple=2    ,    _lowerCAmelCase  :		Optional[int]=6_000    ,    _lowerCAmelCase  :		Tuple=1_024    ,    _lowerCAmelCase  :		Any=2    ,    _lowerCAmelCase  :		str=(5, 5)    ,    _lowerCAmelCase  :		Optional[int]=1_024    ,    _lowerCAmelCase  :		List[Any]=80    ,    _lowerCAmelCase  :		List[Any]=1    ,    **_lowerCAmelCase  :		List[Any]    ,    ):
       SCREAMING_SNAKE_CASE_     						=      vocab_size
       SCREAMING_SNAKE_CASE_     						=      d_model
       SCREAMING_SNAKE_CASE_     						=      encoder_ffn_dim
       SCREAMING_SNAKE_CASE_     						=      encoder_layers
       SCREAMING_SNAKE_CASE_     						=      encoder_attention_heads
       SCREAMING_SNAKE_CASE_     						=      decoder_ffn_dim
       SCREAMING_SNAKE_CASE_     						=      decoder_layers
       SCREAMING_SNAKE_CASE_     						=      decoder_attention_heads
       SCREAMING_SNAKE_CASE_     						=      dropout
       SCREAMING_SNAKE_CASE_     						=      attention_dropout
       SCREAMING_SNAKE_CASE_     						=      activation_dropout
       SCREAMING_SNAKE_CASE_     						=      activation_function
       SCREAMING_SNAKE_CASE_     						=      init_std
       SCREAMING_SNAKE_CASE_     						=      encoder_layerdrop
       SCREAMING_SNAKE_CASE_     						=      decoder_layerdrop
       SCREAMING_SNAKE_CASE_     						=      use_cache
       SCREAMING_SNAKE_CASE_     						=      encoder_layers
       SCREAMING_SNAKE_CASE_     						=      scale_embedding  # scale factor will be sqrt(d_model) if True
       SCREAMING_SNAKE_CASE_     						=      max_source_positions
       SCREAMING_SNAKE_CASE_     						=      max_target_positions
       SCREAMING_SNAKE_CASE_     						=      num_conv_layers
       SCREAMING_SNAKE_CASE_     						=      list(_lowerCAmelCase						)
       SCREAMING_SNAKE_CASE_     						=      conv_channels
       SCREAMING_SNAKE_CASE_     						=      input_feat_per_channel
       SCREAMING_SNAKE_CASE_     						=      input_channels

       if len(self.conv_kernel_sizes						) != self.num_conv_layers:
             raise ValueError(
                 'Configuration for convolutional module is incorrect. '
                 'It is required that `len(config.conv_kernel_sizes)` == `config.num_conv_layers` '
                 F"but is `len(config.conv_kernel_sizes) = {len(self.conv_kernel_sizes						)}`, "
                 F"`config.num_conv_layers = {self.num_conv_layers}`."						)

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