
    oi                         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$ )IncLoraLinear   
base_layeradapter_namec                 (   > [         TU ]  " X40 UD6  g )N)super__init__)selfr   r   kwargs	__class__s       N/home/james-whalen/.local/lib/python3.13/site-packages/peft/tuners/lora/inc.pyr   IncLoraLinear.__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`.
z3Merging LoRA with INC layers is not yet implementedNotImplementedError)r   r   r   s      r   mergeIncLoraLinear.merge(   s     &&[\\r   c                     [        S5      e)zG
This method unmerges all merged adapter layers from the base weights.
z5Unmerging LoRA from INC layers is not yet implementedr   )r   s    r   unmergeIncLoraLinear.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&vFvFJr   )typingr   r&   peft.import_utilsr   peft.tuners.tuners_utilsr   layerr   r	   r'   r(   r)   r6   r!   r   r   <module>r;      sJ   &   . 3  _ _>  r   