'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowercase__  :      Optional[int]        =					logging.get_logger(__name__)

lowercase__  :      Any        =					{
    "tiiuae/falcon-40b": "https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json",
    "tiiuae/falcon-7b": "https://huggingface.co/tiiuae/falcon-7b/resolve/main/config.json",
}







class lowerCamelCase							(	lowerCamelCase					):




  '''simple docstring'''



  lowerCAmelCase__										=	'''falcon'''
  lowerCAmelCase__										=	['''past_key_values''']






  def __init__(      self			:       Optional[Any]  ,							UpperCAmelCase__			:       Optional[int]=6_5024  ,							UpperCAmelCase__			:       List[str]=4544  ,							UpperCAmelCase__			:       Dict=32  ,							UpperCAmelCase__			:       Optional[int]=71  ,							UpperCAmelCase__			:       Dict=1e-5  ,							UpperCAmelCase__			:       Union[str, Any]=0.02  ,							UpperCAmelCase__			:       Dict=True  ,							UpperCAmelCase__			:       Union[str, Any]=0.0  ,							UpperCAmelCase__			:       Union[str, Any]=0.0  ,							UpperCAmelCase__			:       Dict=None  ,							UpperCAmelCase__			:       int=False  ,							UpperCAmelCase__			:       List[str]=False  ,							UpperCAmelCase__			:       Any=True  ,							UpperCAmelCase__			:       Optional[int]=True  ,							UpperCAmelCase__			:       List[str]=False  ,							UpperCAmelCase__			:       List[Any]=11  ,							UpperCAmelCase__			:       int=11  ,							**UpperCAmelCase__			:       Dict  ,							)				->Dict:
        UpperCAmelCase_            =  vocab_size
        # Backward compatibility with n_embed kwarg
        UpperCAmelCase_            =  kwargs.pop('''n_embed'''  ,							UpperCAmelCase__  )
        UpperCAmelCase_            =  hidden_size if n_embed is None else n_embed
        UpperCAmelCase_            =  num_hidden_layers
        UpperCAmelCase_            =  num_attention_heads
        UpperCAmelCase_            =  layer_norm_epsilon
        UpperCAmelCase_            =  initializer_range
        UpperCAmelCase_            =  use_cache
        UpperCAmelCase_            =  hidden_dropout
        UpperCAmelCase_            =  attention_dropout

        UpperCAmelCase_            =  bos_token_id
        UpperCAmelCase_            =  eos_token_id
        UpperCAmelCase_            =  num_attention_heads if num_kv_heads is None else num_kv_heads
        UpperCAmelCase_            =  alibi
        UpperCAmelCase_            =  new_decoder_architecture
        UpperCAmelCase_            =  multi_query  # Ignored when new_decoder_architecture is True
        UpperCAmelCase_            =  parallel_attn
        UpperCAmelCase_            =  bias

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






  @property
  def  lowerCAmelCase__ (      self			:       Dict  )				->Dict:
        return self.hidden_size // self.num_attention_heads






  @property
  def  lowerCAmelCase__ (      self			:       Optional[Any]  )				->Tuple:
        return not self.alibi






'''simple docstring'''
from datetime import datetime

import matplotlib.pyplot as plt
import torch



def  __lowerCamelCase       (      _UpperCamelCase  :  Union[str, Any]					):


      '''simple docstring'''


      for param in module.parameters():
            UpperCAmelCase_            =  False



def  __lowerCamelCase       (      ):


      '''simple docstring'''


      UpperCAmelCase_            =  '''cuda''' if torch.cuda.is_available() else '''cpu'''
      if torch.backends.mps.is_available() and torch.backends.mps.is_built():
            UpperCAmelCase_            =  '''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  __lowerCamelCase       (      _UpperCamelCase  :  Union[str, Any]					):


      '''simple docstring'''


      UpperCAmelCase_            =  plt.imshow(_UpperCamelCase					)
      fig.axes.get_xaxis().set_visible(_UpperCamelCase					)
      fig.axes.get_yaxis().set_visible(_UpperCamelCase					)
      plt.show()





def  __lowerCamelCase       (      ):


      '''simple docstring'''


      UpperCAmelCase_            =  datetime.now()
      UpperCAmelCase_            =  current_time.strftime('''%H:%M:%S'''					)
      return timestamp





