mirror of
https://github.com/finegrain-ai/refiners.git
synced 2024-11-14 00:58:13 +00:00
simplify is_compatible
in lora.py
This commit is contained in:
parent
35868ba34b
commit
0230971543
|
@ -250,9 +250,11 @@ class LinearLora(Lora[fl.Linear]):
|
||||||
)
|
)
|
||||||
|
|
||||||
def is_compatible(self, layer: fl.WeightedModule, /) -> bool:
|
def is_compatible(self, layer: fl.WeightedModule, /) -> bool:
|
||||||
if isinstance(layer, fl.Linear):
|
return (
|
||||||
return layer.in_features == self.in_features and layer.out_features == self.out_features
|
isinstance(layer, fl.Linear)
|
||||||
return False
|
and layer.in_features == self.in_features
|
||||||
|
and layer.out_features == self.out_features
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Conv2dLora(Lora[fl.Conv2d]):
|
class Conv2dLora(Lora[fl.Conv2d]):
|
||||||
|
|
Loading…
Reference in a new issue