mirror of
https://github.com/finegrain-ai/refiners.git
synced 2024-11-09 15:02:01 +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:
|
||||
if isinstance(layer, fl.Linear):
|
||||
return layer.in_features == self.in_features and layer.out_features == self.out_features
|
||||
return False
|
||||
return (
|
||||
isinstance(layer, fl.Linear)
|
||||
and layer.in_features == self.in_features
|
||||
and layer.out_features == self.out_features
|
||||
)
|
||||
|
||||
|
||||
class Conv2dLora(Lora[fl.Conv2d]):
|
||||
|
|
Loading…
Reference in a new issue