Markus28 commited on
Commit
6f8e8c5
1 Parent(s): d9a681b

fix: use staticmethod istead of classmethod

Browse files
Files changed (1) hide show
  1. modeling_lora.py +4 -4
modeling_lora.py CHANGED
@@ -196,13 +196,13 @@ class LoRAParametrization(nn.Module):
196
  ),
197
  )
198
 
199
- @classmethod
200
- def select_task_for_layer(cls, layer: nn.Module, task_idx: Optional[int] = None):
201
  if isinstance(layer, LoRAParametrization):
202
  layer.current_task = task_idx
203
 
204
- @classmethod
205
- def merge_lora_into_layer(cls, layer: nn.Module):
206
  if hasattr(layer, "parametrizations"):
207
  for attr_name in layer.parametrizations.keys():
208
  parametrize.remove_parametrizations(layer, attr_name, leave_parametrized=True)
 
196
  ),
197
  )
198
 
199
+ @staticmethod
200
+ def select_task_for_layer(layer: nn.Module, task_idx: Optional[int] = None):
201
  if isinstance(layer, LoRAParametrization):
202
  layer.current_task = task_idx
203
 
204
+ @staticmethod
205
+ def merge_lora_into_layer(layer: nn.Module):
206
  if hasattr(layer, "parametrizations"):
207
  for attr_name in layer.parametrizations.keys():
208
  parametrize.remove_parametrizations(layer, attr_name, leave_parametrized=True)