Ë
    S^(hQ  ã                   ó>  — d dl Z d dlZd dlmZ 	 d dlZd„ Zd„ Zd„ Zd„ Zd	„ Zd
„ Zdd„Z eej&                  j(                  «       ed«      k\  rd„ Zej,                  j.                  ZeZneZeZeeeeeeeej,                  j2                  ej,                  j4                  ej,                  j6                  ej,                  j6                  ej,                  j8                  dœZd„ Zy# eef$ r/ d dlZ eej                  «      j                  dkD  r ed«      ‚Y �Œw xY w)é    N)Úparseé   zºYour currently installed version of Keras is Keras 3, but this is not yet supported in Transformers. Please install the backwards-compatible tf-keras package with `pip install tf-keras`.c           
      óè   — t        j                  | «      } ddt         j                  j                  | t        j                  t        j
                  d«      | j                  «      z  «      z   z  }| |z  S )av  
    Gaussian Error Linear Unit. Original Implementation of the gelu activation function in Google Bert repo when
    initially created. For information: OpenAI GPT's gelu is slightly different (and gives slightly different results):
    0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3)))) Also see
    https://arxiv.org/abs/1606.08415
    ç      à?ç      ð?ç       @)ÚtfÚconvert_to_tensorÚmathÚerfÚcastÚsqrtÚdtype)ÚxÚcdfs     úY/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/transformers/activations_tf.pyÚ_gelur   "   sU   € ô 	×Ñ˜QÓ€AØ
�”r—w‘w—{‘{ 1¤r§w¡w¬r¯w©w°s«|¸Q¿W¹WÓ'EÑ#EÓFÑFÑ
G€Càˆs‰7€Nó    c                 ón  — t        j                  | «      } t        j                  t        j                  | j
                  «      }t        j                  d| j
                  «      }ddt        j                  t        j                  d|z  «      | |t        j                  | d«      z  z   z  «      z   z  }| |z  S )zò
    Gaussian Error Linear Unit. This is a smoother version of the GELU. Original paper: https://arxiv.org/abs/1606.0841

    Args:
        x: float Tensor to perform activation

    Returns:
        `x` with the GELU activation applied.
    ç÷Hmâä¦?r   r   r   é   )	r	   r
   r   r   Úpir   Útanhr   Úpow)r   r   Úcoeffr   s       r   Ú	_gelu_newr   /   s‡   € ô 	×Ñ˜QÓ€AÜ	�‰”—‘˜!Ÿ'™'Ó	"€BÜ�G‰G�H˜aŸg™gÓ&€EØ
�”r—w‘wœrŸw™w s¨R¡xÓ0°A¸ÄÇÁÀqÈ!ÃÑ8LÑ4LÑMÓNÑNÑ
O€Càˆs‰7€Nr   c                 ó–   — t        j                  | «      } | t        j                  t         j                  j	                  | «      «      z  S )N)r	   r
   r   r   Úsoftplus©r   s    r   Úmishr    A   s5   € Ü
×Ñ˜QÓ€AàŒr�w‰w”r—w‘w×'Ñ'¨Ó*Ó+Ñ+Ð+r   c                 ó  — t        j                  | «      } t        j                  d| j                  «      }t        j                  d| j                  «      }d| z  dt        j                  | |z  d|| z  | z  z   z  «      z   z  S )Nr   g€ÑÓ3Eˆé?r   r   )r	   r
   r   r   r   )r   Úcoeff1Úcoeff2s      r   Ú	gelu_fastr$   G   sm   € Ü
×Ñ˜QÓ€AÜ�W‰W�X˜qŸw™wÓ'€FÜ�W‰W�\ 1§7¡7Ó+€Fà�‰7�cœBŸG™G A¨¡J°#¸À¹
ÀQ¹Ñ2FÑ$GÓHÑHÑIÐIr   c                 ó¶   — t        j                  | «      } t        j                  d| j                  «      }| t         j                  j                  || z  «      z  S )Ng¬Zd;û?)r	   r
   r   r   r   Úsigmoid)r   r   s     r   Ú
quick_gelur'   O   sB   € Ü
×Ñ˜QÓ€AÜ�G‰G�E˜1Ÿ7™7Ó#€EØŒr�w‰w�‰˜u q™yÓ)Ñ)Ð)r   c                 óB   — t        j                  t        | «      dd«      S )a˜  
    Clip the range of possible GeLU outputs between [-10, 10]. This is especially useful for quantization purpose, as
    it allows mapping 2 negatives values in the GeLU spectrum. For more information on this trick, please refer to
    https://arxiv.org/abs/2004.09602

    Gaussian Error Linear Unit. Original Implementation of the gelu activation function in Google Bert repo when
    initially created. For information: OpenAI GPT's gelu is slightly different (and gives slightly different results):
    0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3)))) Also see
    https://arxiv.org/abs/1606.08415 :param x: :return:
    iöÿÿÿé
   )r	   Úclip_by_valuer   r   s    r   Úgelu_10r+   U   s   € ô ×ÑœE !›H c¨2Ó.Ð.r   c                 ó|   — t        j                  | d|¬«      \  }}|t         j                  j                  |«      z  S )aÈ  
    Gated Linear Unit. Implementation as defined in the original paper (see https://arxiv.org/abs/1612.08083), where
    the input `x` is split in two halves across a dimension (`axis`), A and B, returning A * sigmoid(B).

    Args:
        `x`: float Tensor to perform activation
        `axis`: dimension across which `x` be split in half

    Returns:
        `x` with the GLU activation applied (with its size halved across the dimension `axis`).
    r   )Úaxis)r	   Úsplitr   r&   )r   r-   ÚaÚbs       r   Úglur1   c   s2   € ô �8‰8�A�q˜tÔ$�D€A€qØŒr�w‰w�‰˜qÓ!Ñ!Ð!r   z2.4c                 óD   — t         j                  j                  | d¬«      S )NT)Úapproximate)ÚkerasÚactivationsÚgelur   s    r   Úapproximate_gelu_wrapr7   u   s   € Ü× Ñ ×%Ñ% a°TÐ%Ó:Ð:r   )r6   r+   r$   Úgelu_newr1   r    r'   Úrelur&   ÚsiluÚswishr   c           	      ó|   — | t         v r	t         |    S t        d| › dt        t         j                  «       «      › �«      ‚)Nz	function z not found in ACT2FN mapping )ÚACT2FNÚKeyErrorÚlistÚkeys)Úactivation_strings    r   Úget_tf_activationrB   �   sB   € ØœFÑ"ÜÐ'Ñ(Ð(ä˜Ð#4Ð"5Ð5RÔSWÔX^×XcÑXcÓXeÓSfÐRgÐhÓiÐir   )éÿÿÿÿ)r   Ú
tensorflowr	   Úpackaging.versionr   Útf_kerasr4   ÚModuleNotFoundErrorÚImportErrorÚ__version__ÚmajorÚ
ValueErrorr   r   r    r$   r'   r+   r1   ÚversionÚVERSIONr7   r5   r6   r8   r9   r&   r;   r   r=   rB   © r   r   ú<module>rO      s9  ðó ã Ý #ð

Ûò
òò$,òJò*ò/ó"ñ  	ˆ�‰×	Ñ	Ó¡ e£Ò,ò;ð ×Ñ×!Ñ!€DØ$�Hà€DØ€Hð ØØØØØØØ×Ñ×"Ñ"Ø× Ñ ×(Ñ(Ø×Ñ×#Ñ#Ø×Ñ×$Ñ$Ø×Ñ×"Ñ"ñ
€ó jøðq 	˜[Ð)ò 
ÛáˆU×ÑÓ×%Ñ%¨Ò)Ùð&ó
ð 	
ò *ð
ús   �C& Ã&2DÄD