ó
    >:jÁ  ã                  óh   • S SK Jr  S SKJrJr  S SKJrJr  S SKJ	r	  S SK
Jr  \ " S S\	5      5       rg)	é    )Úannotations)Ú	dataclassÚfield)ÚOptionalÚUnion)Ú
PeftConfig)ÚPeftTypec                  óÖ   ^ • \ rS rSr% Sr\" SSS0S9rS\S'   \" SSS	0S9rS
\S'   \" SSS0S9r	S\S'   \" SSS0S9r
S\S'   \" SSS0S9rS\S'   \" SSS0S9rS\S'   U 4S jrSrU =r$ )Ú	OSFConfigé
   aÉ  
Configuration for Orthogonal Subspace Fine-tuning (OSF).

Args:
    effective_rank (`int` or `float`, *optional*):
        Preserved SVD rank ("high" subspace). The top-``effective_rank`` singular directions are frozen and
        retained across tasks; the remaining dimensions form the trainable low-rank subspace. If `None`, defaults
        to 50% of the smaller weight dimension per target module. Note: This differs from LoRA's `r` (trainable
        rank). In OSF, the trainable rank is `min(weight.shape) - effective_rank`.
    target_modules (`Union[list[str], str]`, *optional*):
        The names of the modules to apply OSF to. Can be a list of module names or `"all-linear"`.
    rank_pattern (`dict[str, int|float]`, *optional*):
        A dictionary of regex patterns to override `effective_rank` for specific modules. Values can be absolute
        integers or fractions in (0, 1], interpreted as a fraction of the smaller matrix dimension per target.
NÚhelpa˜  Preserved SVD rank ("high" subspace). The top-`effective_rank` singular directions are frozen and retained across tasks; the remaining dimensions form the trainable low-rank subspace. Trainable rank equals min(weight.shape) - effective_rank. If None, defaults to 50% of the smaller weight dimension per target module. Floats in (0, 1] are interpreted as a fraction of the smaller matrix dimension per target.)ÚdefaultÚmetadatazOptional[Union[int, float]]Úeffective_rankzXThe names of the modules to apply OSF to. Can be a list of module names or 'all-linear'.zOptional[Union[list[str], str]]Útarget_modulesz¸A dictionary of regex patterns to override effective_rank per module. Values can be absolute integers or fractions in (0, 1], interpreted as a fraction of the smaller matrix dimension.z&Optional[dict[str, Union[int, float]]]Úrank_patternzŽIf provided, toggles custom weight initialization behavior for certain methods. OSF ignores this flag but accepts it for config compatibility.zOptional[bool]Úinit_weightszOOptional list of module names to save separately (ignored by OSF but accepted).zOptional[list[str]]Úmodules_to_savez•Optional per-parameter SVD target rank mapping (e.g., {'lin0.weight': 8}). OSF currently ignores this field but accepts it for forward compatibility.zOptional[dict[str, int]]Útarget_svd_configc                óL   >• [         TU ]  5         [        R                  U l        g )N)ÚsuperÚ__post_init__r	   ÚOSFÚ	peft_type)ÚselfÚ	__class__s    €ÚS/home/mande/repo/quber/.venv/lib/python3.13/site-packages/peft/tuners/osf/config.pyr   ÚOSFConfig.__post_init__N   s   ø€ Ü‰ÑÔÜ!Ÿ™ˆ�ó    )r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   Ú__annotations__r   r   r   r   r   r   Ú__static_attributes__Ú__classcell__)r   s   @r   r   r   
   sæ   ø‡ ññ  38Øàð/ð
ñ3€NÐ/ó ñ 7<ØØÐtÐuñ7€NÐ3ó ñ <AØàðnð
ñ<€LÐ8ó ñ $)Øàð@ð
ñ$€L�.ó ñ ,1ØØÐkÐlñ,€OÐ(ó ñ 38ØàðGð
ñ3ÐÐ/ó ÷&ó &r   r   N)Ú
__future__r   Údataclassesr   r   Útypingr   r   Úpeft.configr   Ú
peft.utilsr	   r   © r   r   Ú<module>r.      s2   ðÝ "ç (ß "å "Ý ð ôE&�
ó E&ó ñE&r   