




from __future__ import annotations

import matplotlib.pyplot as plt  # type: ignore
import numpy

# initial triangle of Koch snowflake
lowerCamelCase							:						Optional[Any]					       =  numpy.array([0, 0])
lowerCamelCase							:						Optional[int]					       =  numpy.array([0.5, 0.866_0254])
lowerCamelCase							:						Optional[Any]					       =  numpy.array([1, 0])
lowerCamelCase							:						Dict					       =  [VECTOR_1, VECTOR_2, VECTOR_3, VECTOR_1]

def      _SCREAMING_SNAKE_CASE     (				lowercase      :			list[numpy.ndarray]      ,				lowercase      :			int	):


      '''simple docstring'''



      lowerCamelCase_							=       initial_vectors
      for _ in range(lowercase	):
            lowerCamelCase_							=       iteration_step(lowercase	)
      return vectors

def      _SCREAMING_SNAKE_CASE     (				lowercase      :			list[numpy.ndarray]	):


      '''simple docstring'''



      lowerCamelCase_							=       []
      for i, start_vector in enumerate(vectors[:-1]	):
            lowerCamelCase_							=       vectors[i + 1]
            new_vectors.append(lowercase	)
            lowerCamelCase_							=       end_vector - start_vector
            new_vectors.append(start_vector + difference_vector / 3	)
            new_vectors.append(
                start_vector + difference_vector / 3 + rotate(difference_vector / 3      ,				60	)	)
            new_vectors.append(start_vector + difference_vector * 2 / 3	)
      new_vectors.append(vectors[-1]	)
      return new_vectors

def      _SCREAMING_SNAKE_CASE     (				lowercase      :			numpy.ndarray      ,				lowercase      :			float	):


      '''simple docstring'''



      lowerCamelCase_							=       numpy.radians(lowercase	)
      lowerCamelCase_	,							lowerCamelCase_							=       numpy.cos(lowercase	), numpy.sin(lowercase	)
      lowerCamelCase_							=       numpy.array(((c, -s), (s, c))	)
      return numpy.dot(lowercase      ,				lowercase	)

def      _SCREAMING_SNAKE_CASE     (				lowercase      :			list[numpy.ndarray]	):


      '''simple docstring'''



      lowerCamelCase_							=       plt.gca()
      axes.set_aspect('equal'	)

      # matplotlib.pyplot.plot takes a list of all x-coordinates and a list of all
      # y-coordinates as inputs, which are constructed from the vector-list using
      # zip()
      lowerCamelCase_	,							lowerCamelCase_							=       zip(*lowercase	)
      plt.plot(lowercase      ,				lowercase	)
      plt.show()


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 lowerCamelCase							:						Union[str, Any]					       =  iterate(INITIAL_VECTORS, 5)
 plot(processed_vectors)










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


UpperCAmelCase_           =	logging.get_logger(__name__)

UpperCAmelCase_           =	{
    "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 			__UpperCamelCase    (							A__    ):
     __A	:  Dict							  =   """falcon"""
     __A	:  Any							  =   ["""past_key_values"""]





     def __init__(     self				,							_UpperCamelCase=65024				,							_UpperCamelCase=4544				,							_UpperCamelCase=32				,							_UpperCamelCase=71				,							_UpperCamelCase=1e-5				,							_UpperCamelCase=0.02				,							_UpperCamelCase=True				,							_UpperCamelCase=0.0				,							_UpperCamelCase=0.0				,							_UpperCamelCase=None				,							_UpperCamelCase=False				,							_UpperCamelCase=False				,							_UpperCamelCase=True				,							_UpperCamelCase=True				,							_UpperCamelCase=False				,							_UpperCamelCase=11				,							_UpperCamelCase=11				,							**_UpperCamelCase				,							):
        _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 		UpperCamelCase(     self					):
        return self.hidden_size // self.num_attention_heads





     @property
     def 		UpperCamelCase(     self					):
        return not self.alibi