§
    ‚Štj&;  ã                   óÖ  — d dl mZ d dlmZmZ  e¦   «         rddlZddlmZ ddlmc m	Z
  ej        e¦  «        ZdZdej        dej        fd„Zej        d	ej        d
ej        dej        fd„¦   «         Z G d„ dej        ¦  «        Z G d„ dej        j        ¦  «        Z G d„ dej        j        ¦  «        Z G d„ dej        ¦  «        Zddee         dz  fd„Z G d„ d¦  «        ZdS )é   )Úshould_convert_module)Úis_torch_availableÚloggingé    Né   Úquantized_weightsÚreturnc                 ó  — | j         }|d         t          z   dz
  t          z  }t          |¦  «        dk    r|f}n|g|dd…         ¢R }| dz  } t          j        || j        t          j        ¬¦  «        }|                      t          j        ¦  «        }t          t          |d         |z  dz   ¦  «        }t          |¦  «        D ]C}||z  }t          ||z   |d         ¦  «        }	|d|	|z
  …xx         |||	…         d|z  z  z  cc<   ŒD|S )aÏ  
    Packs a tensor of quantized weights into a compact format using 2 bits per value.

    Parameters:
    -----------
    quantized_weights : torch.Tensor
        A tensor containing ternary quantized weights with values in {-1, 0, 1}. These values are adjusted to
        {0, 1, 2} before being packed.

    Returns:
    --------
    torch.Tensor
        A packed tensor where each element stores 4 quantized values (each using 2 bits) in an 8-bit format.
    r   é   N©ÚdeviceÚdtyper   )
ÚshapeÚVALUES_PER_ITEMÚlenÚtorchÚzerosr   Úuint8ÚtoÚminÚrange)
r   Úoriginal_shapeÚrow_dimÚpacked_tensor_shapeÚpackedÚunpackedÚitÚiÚstartÚends
             ú^/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/integrations/bitnet.pyÚpack_weightsr"      s0  € ð  'Ô,€Nà˜aÔ ¥?Ñ2°QÑ6½?ÑJ€Gå
ˆ>ÑÔ˜aÒÐØ&˜jÐÐà&Ð<¨¸¸¸Ô);Ð<Ð<Ðà˜ÑÐÝŒ[Ð,Ð5FÔ5MÕUZÔU`ÐaÑaÔa€FØ ×#Ò#¥E¤KÑ0Ô0€Hå	�_˜~¨aÔ0°GÑ;¸qÑ@Ñ	AÔ	A€BÝ�2‰YŒYð @ð @ˆØ�G‘ˆÝ�%˜'‘/ >°!Ô#4Ñ5Ô5ˆØˆ�#˜‘+ˆÐÐÔ 8¨E°#¨IÔ#6¸!¸a¹%Ñ#?Ñ?ÐÐÑÐà€Mó    r   r   c                 ó   — | j         }t          |¦  «        dk    r|d         t          z  }|f}n|d         t          z  }|g|dd…         ¢R }t          j        || j        t          j        ¬¦  «        }t          t          ¦  «        D ]0}||d         z  }||d         z   }dd|z  z  }	| |	z  d|z  z	  |||…<   Œ1|                     |¦  «        dz
  S )u2  
    Unpacks a tensor of quantized weights that were stored in a packed format using 2 bits per value.

    Parameters:
    -----------
    packed : torch.Tensor
        A tensor containing packed weights where each element represents 4 quantized values (using 2 bits per value).
    dtype : torch.dtype
        The dtype of the returned Tensor
    Returns:
    --------
    torch.Tensor
        A tensor of unpacked weights, where each value is converted from its packed 2-bit representation.

    Example:
    --------
    packed = torch.tensor([[0b10100001, 0b00011000],
                           [0b10010000, 0b00001010]], dtype=torch.uint8)

    # Unpack the values
    unpacked = unpack_weights(packed)

    # Resulting unpacked tensor
    print(unpacked)
    # Output: tensor([[ 0, -1],
                      [-1,  1],
                      [-1,  1],
                      [-1,  1],
                      [ 1,  0],
                      [ 0, -1],
                      [ 1, -1],
                      [ 1, -1]])

    Explanation of the example:
    ---------------------------
    Let's take the first value for example 0b10100001, we will only focus on the first column,
    because every element is unpacked across the first dimension
    - First 2 bits: `01` â†’ 0 at [0][0]
    - Second 2 bits: `00` â†’ -1 at [0][2]
    - Third 2 bits: `10` â†’ 1 at [0][4]
    - Fourth 2 bits: `10` â†’ 1 at [0][6]
    the second value of the same row (0b10010000) will give the values for [0][1], [0][3], [0][5], [0][7]

    We subtract 1 because during the packing process, it's easier to work with values like 0, 1, and 2. To make this possible,
    we add 1 to the original ternary weights (which are typically -1, 0, and 1) when packing them. When unpacking, we reverse
    this by subtracting 1 to restore the original ternary values.
    r   r   Nr   é   r   )	r   r   r   r   r   r   r   r   r   )
r   r   Úpacked_shapeÚoriginal_row_dimÚunpacked_shaper   r   r   r    Úmasks
             r!   Úunpack_weightsr*   7   sï   € ðb ”<€Lå
ˆ<ÑÔ˜AÒÐØ'¨œ?­_Ñ<ÐØ*Ð,ˆˆà'¨œ?­_Ñ<ÐØ*Ð>¨\¸!¸"¸"Ô-=Ð>Ð>ˆåŒ{˜>°&´-ÅuÄ{ÐSÑSÔS€Hå•?Ñ#Ô#ð 9ð 9ˆØ�L ”OÑ#ˆØ�l 1”oÑ%ˆØ�Q˜‘U‰|ˆØ%¨™}°!°a±%Ñ8ˆ��s�ÑÐà�;Š;�uÑÔ Ñ!Ð!r#   c                   ó†   ‡ — e Zd Z	 	 	 	 ddededededef
ˆ fd	„Zej        dd„¦   «         Z	ej        d„ ¦   «         Z
d„ Zˆ xZS )Ú	BitLinearNFç�íµ ÷Æ°>Úin_featuresÚout_featuresÚbiasÚuse_rms_normÚrms_norm_epsc                 óö  •— t          ¦   «                              ¦   «          || _        || _        || _        |                      dt          j        |t          z  |ft          j	        |¬¦  «        ¦  «         |                      dt          j
        d||¬¦  «        ¦  «         |r,|                      dt          j        |||¬¦  «        ¦  «         nd | _        d | _        |rddlm}  |||¬¦  «        | _        d S d S )	NÚweight©r   r   Úweight_scaler   r0   r   ©ÚLlamaRMSNorm©Úeps)ÚsuperÚ__init__r   r.   r/   Úregister_bufferr   r   r   r   Úonesr0   Úrms_normÚmodels.llama.modeling_llamar8   )
Úselfr.   r/   r0   r   r   r1   r2   r8   Ú	__class__s
            €r!   r<   zBitLinear.__init__}   s6  ø€ õ 	‰Œ×ÒÑÔÐØˆŒ
Ø&ˆÔØ(ˆÔØ×ÒØÝŒKØ¥Ñ0°+Ð>Ý”kØðñ ô ñ	
ô 	
ð 	
ð 	×ÒØÝŒJØØØðñ ô ñ	
ô 	
ð 	
ð ð 	Ø× Ò  ­¬°lÈ5ÐY_Ð)`Ñ)`Ô)`ÑaÔaÐaÐaàˆDŒIð ˆŒØð 	HØBÐBÐBÐBÐBÐBà(˜L¨¸,ÐGÑGÔGˆDŒMˆMˆMð	Hð 	Hr#   é   c                 óL  — d|dz
  z   }d|dz
  z  dz
  }||                      ¦   «                              dd¬¦  «        j                             d¬¦  «        z  }||z                       ¦   «                              ||¦  «        }|                     t          j        ¦  «        |fS )a\  
        Activation function : Performs symmetric, per-token quantization on the input activations.
        Parameters:
        -----------
        input : torch.Tensor
            Input activations to be quantized.
        num_bits : int, optional (default=8)
            Number of bits to use for quantization, determining the quantization range.

        Returns:
        --------
        result : torch.Tensor
            Quantized activation tensor, with values mapped to an `int8` range.
        scale : torch.Tensor
            The per-channel scaling factors used to quantize the tensor.
        r   r   éÿÿÿÿT©ÚdimÚkeepdimçñhãˆµøä>©r   )ÚabsÚmaxÚvaluesÚclampÚroundr   r   Úint8)rA   ÚinputÚnum_bitsÚQnÚQpÚscaleÚresults          r!   Úactivation_quantzBitLinear.activation_quant§   sœ   € ð$ �X ‘\Ñ"Ð#ˆØ�8˜a‘<Ñ  1Ñ$ˆØ�U—Y’Y‘[”[—_’_¨°T�_Ñ:Ô:ÔA×GÒGÈDÐGÑQÔQÑQˆØ˜%‘-×&Ò&Ñ(Ô(×.Ò.¨r°2Ñ6Ô6ˆØ�yŠy�œÑ$Ô$ eÐ+Ð+r#   c                 ó   — |||z  z  }|S ©N© )rA   rQ   Úinput_scaler6   Úouts        r!   Úpost_quant_processzBitLinear.post_quant_process¿   s   € à�{ \Ñ1Ñ2ˆØˆ
r#   c                 óª  — | j         �|                       |¦  «        }| j        }t          || j        ¬¦  «        }|                      |¦  «        \  }}t          j        |                     | j        ¦  «        |¦  «        }|                      || j	        |¦  «        }| j
        �1|| j
                             dd¦  «                             |¦  «        z  }|S )N©r   r   rE   )r?   r4   r*   r   rW   ÚFÚlinearr   r]   r6   r0   ÚviewÚ	expand_as)rA   rQ   ÚwÚw_quantÚinput_quantr[   Úys          r!   ÚforwardzBitLinear.forwardÄ   s¼   € àŒ=Ð$Ø—M’M %Ñ(Ô(ˆEàŒKˆÝ  ¨$¬*Ð5Ñ5Ô5ˆØ#'×#8Ò#8¸Ñ#?Ô#?Ñ ˆ�[ÝŒH�[—^’^ D¤JÑ/Ô/°Ñ9Ô9ˆØ×#Ò# A tÔ'8¸+ÑFÔFˆØŒ9Ð Ø�”—’  2Ñ&Ô&×0Ò0°Ñ3Ô3Ñ3ˆAØˆr#   )NNFr-   )rC   )Ú__name__Ú
__module__Ú__qualname__ÚintÚboolÚfloatr<   r   ÚcompilerW   r]   rh   Ú__classcell__©rB   s   @r!   r,   r,   |   sÛ   ø€ € € € € ð ØØ"Ø"ð(Hð (Hàð(Hð ð(Hð ð	(Hð ð(Hð ð(Hð (Hð (Hð (Hð (Hð (HðT „]ð,ð ,ð ,ñ „]ð,ð. „]ðð ñ „]ððð ð ð ð ð ð r#   r,   c                   óX   — e Zd ZdZeej        d„ ¦   «         ¦   «         Zed„ ¦   «         ZdS )ÚWeightQuanta  
    Implements a custom autograd function for weight quantization.
    This performs ternary quantization (-1, 0, 1) based on scaling by the
    mean absolute value of the weights. It uses the Straight-Through Estimator
    (STE) for the backward pass.
    c                 ó8  — |j         }|                     ¦   «         }d|                     ¦   «                              ¦   «                              d¬¦  «        z  }||z                       ¦   «                              dd¦  «        |z  }|                     |¦  «        S )Ng      ð?rI   rJ   rE   r   )r   rn   rK   ÚmeanÚclamp_rO   rN   r   )Úctxr4   r   rU   s       r!   rh   zWeightQuant.forwardÛ   sƒ   € ð ”ˆØ—’‘”ˆØ�f—j’j‘l”l×'Ò'Ñ)Ô)×0Ò0°TÐ0Ñ:Ô:Ñ:ˆØ˜5‘.×'Ò'Ñ)Ô)×/Ò/°°AÑ6Ô6¸Ñ>ˆØ�yŠy˜ÑÔÐr#   c                 ó.   — |                      ¦   «         }|S rY   ©Úclone©rw   Úgrad_outputÚ
grad_inputs      r!   ÚbackwardzWeightQuant.backwardä   ó   € à ×&Ò&Ñ(Ô(ˆ
ØÐr#   N©	ri   rj   rk   Ú__doc__Ústaticmethodr   ro   rh   r~   rZ   r#   r!   rs   rs   Ó   s`   € € € € € ðð ð Ø
„]ð ð  ñ „]ñ „\ð ð ðð ñ „\ðð ð r#   rs   c                   óX   — e Zd ZdZeej        d„ ¦   «         ¦   «         Zed„ ¦   «         ZdS )ÚActQuanta8  
    Implements a custom autograd function for activation quantization.
    This performs symmetric 8-bit quantization (to the range [-128, 127])
    based on the maximum absolute value along the last dimension (per-token/row scaling).
    It uses the Straight-Through Estimator (STE) for the backward pass.
    c                 óH  — |j         }|                     ¦   «         }d|                     ¦   «                              dd¬¦  «        j                             d¬¦  «        z  }||z                       ¦   «                              dd¦  «        |z  }|                     |¦  «        S )Né   rE   TrF   rI   rJ   i€ÿÿÿ)	r   rn   rK   rL   rM   rv   rO   rN   r   )rw   Ú
activationr   rU   s       r!   rh   zActQuant.forwardò   s–   € ð Ô ˆØ×%Ò%Ñ'Ô'ˆ
Ø�j—n’nÑ&Ô&×*Ò*¨r¸4Ð*Ñ@Ô@ÔG×NÒNÐSWÐNÑXÔXÑXˆØ  5Ñ(×/Ò/Ñ1Ô1×7Ò7¸¸cÑBÔBÀUÑJˆ
Ø�}Š}˜UÑ#Ô#Ð#r#   c                 ó.   — |                      ¦   «         }|S rY   ry   r{   s      r!   r~   zActQuant.backwardû   r   r#   Nr€   rZ   r#   r!   r„   r„   ê   s`   € € € € € ðð ð Ø
„]ð$ð $ñ „]ñ „\ð$ð ðð ñ „\ðð ð r#   r„   c                   óR   ‡ — e Zd Z	 	 	 	 	 	 ddedededed	ed
efˆ fd„Zd„ Zd„ Zˆ xZ	S )ÚAutoBitLinearTNFr-   r.   r/   r0   Úonline_quantr1   r2   c	                 ó0  •— t          ¦   «                              |||¦  «         || _        d | _        |rddlm}	  |	||¬¦  «        | _        |sG|                      dt          j        d||¬¦  «        ¦  «         |  	                    | j
        ¦  «         d S d S )Nr   r7   r9   r6   r   r5   )r;   r<   r‹   r?   r@   r8   r=   r   r>   Ú"_register_load_state_dict_pre_hookÚ	load_hook)rA   r.   r/   r0   r   r   r‹   r1   r2   r8   rB   s             €r!   r<   zAutoBitLinear.__init__  sÌ   ø€ õ 	‰Œ×Ò˜ l°DÑ9Ô9Ð9Ø(ˆÔàˆŒØð 	HØBÐBÐBÐBÐBÐBà(˜L¨¸,ÐGÑGÔGˆDŒMØð 		DØ× Ò ØÝ”
ØØØ!ðñ ô ñô ð ð ×3Ò3°D´NÑCÔCÐCÐCÐCð		Dð 		Dr#   c                 ó¤   — |dz   |v rH||dz            j         | j        j         k    r*t          ||dz            | j        j         ¬¦  «        ||dz   <   |S )Nr4   r_   )r   r4   r*   )rA   Ú
state_dictÚprefixÚargsÚkwargss        r!   rŽ   zAutoBitLinear.load_hook   se   € ð �XÑ *Ð,Ð,°¸FÀXÑ<MÔ1NÔ1TÐX\ÔXcÔXiÒ1iÐ1iÝ,:¸:ÀfÈxÑFWÔ;XÐ`dÔ`kÔ`qÐ,rÑ,rÔ,rˆJ�v Ñ(Ñ)ØÐr#   c                 ó&  — | j         �|                       |¦  «        }| j        r t                               | j        ¦  «        }n| j        }t
                               |¦  «        }t          j        ||| j        ¦  «        }| j        s
|| j	        z  }|S rY   )
r?   r‹   rs   Úapplyr4   r„   r`   ra   r0   r6   )rA   rQ   r4   Úoutputs       r!   rh   zAutoBitLinear.forward+  s‡   € àŒ=Ð$Ø—M’M %Ñ(Ô(ˆEàÔð 	!Ý ×&Ò& t¤{Ñ3Ô3ˆFˆFà”[ˆFÝ—’˜uÑ%Ô%ˆÝ”˜% ¨¬Ñ3Ô3ˆØÔ ð 	0Ø˜dÔ/Ñ/ˆFØˆr#   )TNNFFr-   )
ri   rj   rk   rl   rm   rn   r<   rŽ   rh   rp   rq   s   @r!   rŠ   rŠ     s»   ø€ € € € € ð
 ØØØ"Ø"Ø"ðDð DàðDð ðDð ð	Dð ðDð ðDð ðDð Dð Dð Dð Dð Dð<	ð 	ð 	ðð ð ð ð ð ð r#   rŠ   Úmodules_to_not_convertc                 ó  — d}|                       ¦   «         D �]T\  }}t          ||¦  «        sŒt          j        d¦  «        5  t	          |t
          j        ¦  «        r÷|r{|j        dk    rpt          |j	        |j
        |j        du|j        j        |j        j        |j        dk    |j        |j        ¬¦  «        }|j        dk    r|                     d¦  «         nbt%          |j	        |j
        |j        du|j        j        |j        j        |r|j        nd|r|j        nd¬	¦  «        }|                     d¦  «         |                      ||¦  «         d
}ddd¦  «         n# 1 swxY w Y   �ŒV|st(                               d¦  «         | S )aa  
    Public method that replaces the linear layers of the given model with bitnet quantized layers.

    Args:
        model (`torch.nn.Module`):
            The model to convert, can be any `torch.nn.Module` instance.
        modules_to_not_convert (`list[str]`, *optional*, defaults to `None`):
            A list of nn.Linear weights to not convert. If a parameter path is in the list (e.g. `lm_head.weight`), the corresponding module will not be
            converted.
        quantization_config (`BitNetConfig`):
            The quantization config object that contains the quantization parameters.
    FÚmetaÚautobitlinearNÚonline)r.   r/   r0   r   r   r‹   r1   r2   Úoffliner-   )r.   r/   r0   r   r   r1   r2   Tz½You are loading your model using bitnet but no linear modules were found in your model. Please double check your model architecture, or submit an issue on github if you think this is a bug.)Únamed_modulesr   r   r   Ú
isinstanceÚnnÚLinearÚlinear_classrŠ   r.   r/   r0   r4   r   Úquantization_moder1   r2   Úrequires_grad_r,   Úset_submoduleÚloggerÚwarning)Úmodelr—   Úquantization_configÚhas_been_replacedÚmodule_nameÚmoduleÚ
new_modules          r!   Úreplace_with_bitnet_linearr­   ;  s  € ð Ðà$×2Ò2Ñ4Ô4ð )ñ )Ñˆ�VÝ$ [Ð2HÑIÔIð 	ØÝŒ\˜&Ñ!Ô!ð 	)ð 	)Ý˜&¥"¤)Ñ,Ô,ð )Ø&ð 5Ð+>Ô+KÈÒ+^Ð+^Ý!.Ø$*Ô$6Ø%+Ô%8Ø#œ[°Ð4Ø%œ}Ô3Ø$œmÔ1Ø&9Ô&KÈxÒ&WØ%8Ô%EØ%8Ô%Eð	"ñ 	"ô 	"�Jð +Ô<À	ÒIÐIØ"×1Ò1°%Ñ8Ô8Ð8øå!*Ø$*Ô$6Ø%+Ô%8Ø#œ[°Ð4Ø%œ}Ô3Ø$œmÔ1ØI\Ð%gÐ%8Ô%EÐ%EÐbgØI\Ð%fÐ%8Ô%EÐ%EÐbfð"ñ "ô "�Jð ×-Ò-¨eÑ4Ô4Ð4Ø×#Ò# K°Ñ<Ô<Ð<Ø$(Ð!ð7	)ð 	)ð 	)ñ 	)ô 	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)øøøð 	)ð 	)ð 	)ð 	)ùð: ð 
Ý�Šðñ	
ô 	
ð 	
ð €Ls   ÁDE Å E$	Å'E$	c                   ó’   — e Zd Zd„ Z	 	 ddeeeej                 f         dej	        j
        dz  dedz  deeej        f         fd„ZdS )	ÚBitNetDeserializec                 ó   — || _         d S rY   )Úhf_quantizer)rA   r±   s     r!   r<   zBitNetDeserialize.__init__v  s   € Ø(ˆÔÐÐr#   NÚ
input_dictr§   Úfull_layer_namer	   c                 ó  — |                      ¦   «         D ]%\  }}t          |t          ¦  «        r|d         ||<   Œ&d}|                     |¦  «        }ddlm}	 d}
|j        }|�q|�o |	||¦  «        \  }}t          |d¦  «        rPt          |d¦  «        r@|j        }|j	        d         }|t          z  |k    rd}
t          |d	¦  «        r|j        j        }|
r0|                     t          j        ¦  «        }t          ||¬
¦  «        }||iS )Nr   r4   r   )Úget_module_from_nameFr/   r.   Tr6   r_   )Úitemsrž   ÚlistÚpopÚquantizers.quantizers_utilsrµ   r   Úhasattrr/   r   r   r6   r   r   r   r*   )rA   r²   r§   r³   r“   ÚkeyÚvalueÚ
key_weightr4   rµ   Úneeds_unpackingÚtarget_dtyper«   Ú_Úexpected_outÚ
actual_outÚweight_uint8s                    r!   ÚconvertzBitNetDeserialize.converty  s@  € ð %×*Ò*Ñ,Ô,ð 	+ð 	+‰JˆC�Ý˜%¥Ñ&Ô&ð +Ø"'¨¤(�
˜3‘øØˆ
Ø—’ 
Ñ+Ô+ˆØFÐFÐFÐFÐFÐFàˆØ”|ˆØÐ Ð!<Ø,Ð,¨U°OÑDÔD‰IˆF�AÝ�v˜~Ñ.Ô.ð Aµ7¸6À=Ñ3QÔ3Qð Að  &Ô2�Ø#œ\¨!œ_�
Ø¥Ñ/°<Ò?Ð?Ø&*�Oõ ˜v ~Ñ6Ô6ð AØ'-Ô':Ô'@˜Øð 	FØ!Ÿ9š9¥U¤[Ñ1Ô1ˆLÝ# L¸ÐEÑEÔEˆFØ˜FÐ#Ð#r#   ©NN)ri   rj   rk   r<   ÚdictÚstrr·   r   ÚTensorrŸ   ÚModulerÄ   rZ   r#   r!   r¯   r¯   u  s”   € € € € € ð)ð )ð )ð )-Ø&*ð	!$ð !$à˜˜d 5¤<Ô0Ð0Ô1ð!$ð ŒxŒ Ñ%ð!$ð ˜t™ð	!$ð 
ˆc�5”<ÐÔ	 ð!$ð !$ð !$ð !$ð !$ð !$r#   r¯   rÅ   ) r¹   r   Úutilsr   r   r   Útorch.nnrŸ   Útorch.nn.functionalÚ
functionalr`   Ú
get_loggerri   r¥   r   rÈ   r"   ro   r   r*   rÉ   r,   ÚautogradÚFunctionrs   r„   r    rŠ   r·   rÇ   r­   r¯   rZ   r#   r!   ú<module>rÑ      s  ðØ ?Ð ?Ð ?Ð ?Ð ?Ð ?Ø /Ð /Ð /Ð /Ð /Ð /Ð /Ð /ð ÐÑÔð $Ø€L€L€LØÐÐÐÐÐØ#Ð#Ð#Ð#Ð#Ð#Ð#Ð#Ð#à	ˆÔ	˜HÑ	%Ô	%€ð €ð# E¤Lð #°U´\ð #ð #ð #ð #ðL „ðA"˜5œ<ð A"°´ð A"ÀÄð A"ð A"ð A"ñ „ðA"ðHTð Tð Tð Tð T�”	ñ Tô Tð Tðnð ð ð ð �%”.Ô)ñ ô ð ð.ð ð ð ð ˆuŒ~Ô&ñ ô ð ð.7ð 7ð 7ð 7ð 7�B”Iñ 7ô 7ð 7ðt7ð 7¸dÀ3¼iÈ$Ñ>Nð 7ð 7ð 7ð 7ðt%$ð %$ð %$ð %$ð %$ñ %$ô %$ð %$ð %$ð %$r#   