Skip to content

Commit 62dcb13

Browse files
committed
test: expand coverage in test_stablediffusion.py and test_vision_models.py
Also formatted code using make style.
1 parent 7829971 commit 62dcb13

File tree

5 files changed

+206
-110
lines changed

5 files changed

+206
-110
lines changed

src/peft/tuners/loha/config.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)