






'''simple docstring'''

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


UpperCamelCase							=logging.get_logger(__name__)

UpperCamelCase							={
    "bigcode/gpt_bigcode-santacoder": "https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json",
}




class     A    (      SCREAMING_SNAKE_CASE__						):






 """simple docstring"""





 __a			:						Tuple   =						'''gpt_bigcode'''
 __a			:						Optional[int]   =						['''past_key_values''']
 __a			:						List[Any]   =						{
     '''hidden_size''': '''n_embd''',
     '''max_position_embeddings''': '''n_positions''',
     '''num_attention_heads''': '''n_head''',
     '''num_hidden_layers''': '''n_layer''',
 }
 def __init__(							self			,     __lowerCAmelCase=5_02_57			,     __lowerCAmelCase=10_24			,     __lowerCAmelCase=7_68			,     __lowerCAmelCase=12			,     __lowerCAmelCase=12			,     __lowerCAmelCase=None			,     __lowerCAmelCase="gelu_pytorch_tanh"			,     __lowerCAmelCase=0.1			,     __lowerCAmelCase=0.1			,     __lowerCAmelCase=0.1			,     __lowerCAmelCase=1E-5			,     __lowerCAmelCase=0.02			,     __lowerCAmelCase=True			,     __lowerCAmelCase=True			,     __lowerCAmelCase=5_02_56			,     __lowerCAmelCase=5_02_56			,     __lowerCAmelCase=True			,     __lowerCAmelCase=True			,     __lowerCAmelCase=True			,     **__lowerCAmelCase			,     ):
       UpperCamelCase_				:   Optional[int]					    =							vocab_size
       UpperCamelCase_				:   Optional[int]					    =							n_positions
       UpperCamelCase_				:   Dict					    =							n_embd
       UpperCamelCase_				:   List[str]					    =							n_layer
       UpperCamelCase_				:   str					    =							n_head
       UpperCamelCase_				:   int					    =							n_inner
       UpperCamelCase_				:   Optional[Any]					    =							activation_function
       UpperCamelCase_				:   int					    =							resid_pdrop
       UpperCamelCase_				:   Dict					    =							embd_pdrop
       UpperCamelCase_				:   Tuple					    =							attn_pdrop
       UpperCamelCase_				:   Any					    =							layer_norm_epsilon
       UpperCamelCase_				:   Union[str, Any]					    =							initializer_range
       UpperCamelCase_				:   List[Any]					    =							scale_attn_weights
       UpperCamelCase_				:   Dict					    =							use_cache
       UpperCamelCase_				:   Dict					    =							attention_softmax_in_fpaa
       UpperCamelCase_				:   Union[str, Any]					    =							scale_attention_softmax_in_fpaa
       UpperCamelCase_				:   Tuple					    =							multi_query

       UpperCamelCase_				:   Any					    =							bos_token_id
       UpperCamelCase_				:   Optional[Any]					    =							eos_token_id

       super().__init__(bos_token_id=__lowerCAmelCase			,     eos_token_id=__lowerCAmelCase			,     **__lowerCAmelCase )














'''simple docstring'''

from datetime import datetime

import matplotlib.pyplot as plt
import torch



def 							snake_case					(     a_							: List[Any]	)       ->				Any:





      """simple docstring"""

      for param in module.parameters():
            UpperCamelCase_				:   Dict					    =							False



def 							snake_case					(     )       ->				List[str]:





      """simple docstring"""

      UpperCamelCase_				:   List[str]					    =							"""cuda""" if torch.cuda.is_available() else """cpu"""
      if torch.backends.mps.is_available() and torch.backends.mps.is_built():
            UpperCamelCase_				:   int					    =							"""mps"""
      if device == "mps":
            print(
                """WARNING: MPS currently doesn't seem to work, and messes up backpropagation without any visible torch"""
                """ errors. I recommend using CUDA on a colab notebook or CPU instead if you're facing inexplicable issues"""
                """ with generations."""	)
      return device



def 							snake_case					(     a_							: str	)       ->				Dict:





      """simple docstring"""

      UpperCamelCase_				:   Optional[int]					    =							plt.imshow(a_	)
      fig.axes.get_xaxis().set_visible(a_	)
      fig.axes.get_yaxis().set_visible(a_	)
      plt.show()



def 							snake_case					(     )       ->				Optional[Any]:





      """simple docstring"""

      UpperCamelCase_				:   Optional[Any]					    =							datetime.now()
      UpperCamelCase_				:   int					    =							current_time.strftime("""%H:%M:%S"""	)
      return timestamp






