@@ -50,11 +50,11 @@ class LoHaConfig(LycorisConfig):
5050 When passing a list of strings, either an exact match will be performed or it is checked if the name of the
5151 module ends with any of the passed strings.
5252 init_weights (`Union[bool, Literal["abba"]]`):
53- How to initialize the weights of the LoHa layers. Pass `True` (default) for default initialization,
54- `False` for random initialization, or `'abba'` for ABBA initialization which approximates pretrained weights
55- using SVD decomposition, potentially improving training stability and convergence.
56- Based on the ABBA paper: https://arxiv.org/pdf/2505.14238
57- See https://github.com/huggingface/peft/issues/2587 for implementation details.
53+ How to initialize the weights of the LoHa layers. Pass `True` (default) for default initialization, `False`
54+ for random initialization, or `'abba'` for ABBA initialization which approximates pretrained weights using
55+ SVD decomposition, potentially improving training stability and convergence. Based on the ABBA paper:
56+ https://arxiv.org/pdf/2505.14238 See https://github.com/huggingface/peft/issues/2587 for implementation
57+ details.
5858 layers_to_transform (`Union[List[int], int]`):
5959 The layer indices to transform. If a list of ints is passed, it will apply the adapter to the layer indices
6060 that are specified in this list. If a single integer is passed, it will apply the transformations on the
@@ -73,13 +73,13 @@ class LoHaConfig(LycorisConfig):
7373 """
7474
7575 r : int = field (
76- default = 8 ,
76+ default = 8 ,
7777 metadata = {
7878 "help" : (
7979 "LoHa rank for the first Hadamard component. For standard LoHa, both components use this rank. "
8080 "For asymmetric ranks, use r2 to specify a different rank for the second component."
8181 )
82- }
82+ },
8383 )
8484 r2 : Optional [int ] = field (
8585 default = None ,
@@ -178,4 +178,4 @@ def __post_init__(self):
178178 )
179179 # check for layers_to_transform and layers_pattern
180180 if self .layers_pattern and not self .layers_to_transform :
181- raise ValueError ("When `layers_pattern` is specified, `layers_to_transform` must also be specified. " )
181+ raise ValueError ("When `layers_pattern` is specified, `layers_to_transform` must also be specified. " )
0 commit comments