ó
    >:j�  ã                   ó¤   • S SK Jr  S SKrS SKJr  S SKJr  SSKJr  \" 5       (       a   " S S\5      r	S	\R                  R                  S
\4S jrg)é    )ÚOptionalN)Úis_inc_available)ÚBaseTunerLayeré   )ÚLinearc                   óŒ   ^ • \ rS rSrS\R
                  R                  S\4U 4S jjrSS\	S\
\\      SS4S	 jjrSS
 jrSrU =r$ )ÚIncOFTLinearé   Ú
base_layerÚadapter_namec                 ó(   >• [         TU ]  " X40 UD6  g )N)ÚsuperÚ__init__)Úselfr   r   ÚkwargsÚ	__class__s       €ÚP/home/mande/repo/quber/.venv/lib/python3.13/site-packages/peft/tuners/oft/inc.pyr   ÚIncOFTLinear.__init__    s   ø€ ô ‰GÒ˜ZÑ@¸Ó@ó    NÚ
safe_mergeÚadapter_namesÚreturnc                 ó   • [        S5      e)a  
Merge the active adapter weights into the base weights

Args:
    safe_merge (`bool`, *optional*):
        If True, the merge operation will be performed in a copy of the original weights and check for NaNs
        before merging the weights. This is useful if you want to check if the merge operation will produce
        NaNs. Defaults to `False`.
    adapter_names (`list[str]`, *optional*):
        The list of adapter names that should be merged. If None, all active adapters will be merged.
        Defaults to `None`.
z2Merging OFT with INC layers is not yet implemented©ÚNotImplementedError)r   r   r   s      r   ÚmergeÚIncOFTLinear.merge(   s   € ô &Ð&ZÓ[Ð[r   c                 ó   • [        S5      e)zG
This method unmerges all merged adapter layers from the base weights.
z4Unmerging OFT from INC layers is not yet implementedr   )r   s    r   ÚunmergeÚIncOFTLinear.unmerge7   s   € ô &Ð&\Ó]Ð]r   © )FN)r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__ÚtorchÚnnÚModuleÚstrr   Úboolr   Úlistr   r   Ú__static_attributes__Ú__classcell__)r   s   @r   r	   r	      sY   ø† ð	AàŸ™Ÿ™ð	Að ÷	Añ	\ Dð 	\ÀÈ$ÈsÉ)ÑATð 	\Ð`dõ 	\÷	^ò 	^r   r	   Útargetr   c                 ó¼   • S n[        U [        5      (       a  U R                  5       nOU n[        5       (       a"  SSKJn  [        XE5      (       a  [        X40 UD6nU$ )Nr   )ÚPatchedLinear)Ú
isinstancer   Úget_base_layerr   ÚIneural_compressor.torch.algorithms.fp8_quant._quant_common.helper_modulesr0   r	   )r.   r   r   Ú
new_moduleÚtarget_base_layerr0   s         r   Údispatch_incr6   >   sZ   € Ø€Jä�&œ.×)Ñ)Ø"×1Ñ1Ó3Ñà"Ðä×Ñõ	
ô Ð'×7Ñ7Ü% fÑE¸fÑEˆJàÐr   )Útypingr   r&   Úpeft.import_utilsr   Úpeft.tuners.tuners_utilsr   Úlayerr   r	   r'   r(   r)   r6   r!   r   r   Ú<module>r;      sJ   ðõ& ã å .Ý 3å ñ ×Ñô^�vô ^ð>˜Ÿ™Ÿ™ð ¸õ r   