Skip to content

Commit

Permalink
rename MTLLoRA test method
Browse files Browse the repository at this point in the history
  • Loading branch information
Francois Ledoyen authored and Francois Ledoyen committed Feb 10, 2025
1 parent 7b480c6 commit 9781d4f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/test_methods/method_test_impl/peft/test_mtllora.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@require_torch
class MTLLoRATestMixin(AdapterMethodBaseTestMixin):
def test_add_mtl_lora(self):
def test_add_mtllora(self):
model = self.get_model()
config = MTLLoRAConfig()
self.run_add_test(
Expand All @@ -18,11 +18,11 @@ def test_add_mtl_lora(self):
],
)

def test_leave_out_mtl_lora(self):
def test_leave_out_mtllora(self):
model = self.get_model()
self.run_leave_out_test(model, MTLLoRAConfig(), self.leave_out_layers)

def test_delete_mtl_lora(self):
def test_delete_mtllora(self):
model = self.get_model()
config = MTLLoRAConfig()
self.run_delete_test(
Expand All @@ -33,7 +33,7 @@ def test_delete_mtl_lora(self):
],
)

def test_get_mtl_lora(self):
def test_get_mtllora(self):
model = self.get_model()
n_layers = len(list(model.iter_layers()))
self.run_get_test(
Expand All @@ -42,7 +42,7 @@ def test_get_mtl_lora(self):
n_layers * 3,
)

def test_forward_mtl_lora(self):
def test_forward_mtllora(self):
model = self.get_model()
for dtype in self.dtypes_to_test:
for n_proj in [1, 3]:
Expand All @@ -62,14 +62,14 @@ def test_forward_mtl_lora(self):
dtype=dtype,
)

def test_load_mtl_lora(self):
def test_load_mtllora(self):
self.run_load_test(MTLLoRAConfig())

def test_load_full_model_mtl_lora(self):
def test_load_full_model_mtllora(self):
self.run_full_model_load_test(MTLLoRAConfig(init_weights="bert"))

def test_train_mtl_lora(self):
def test_train_mtllora(self):
self.run_train_test(MTLLoRAConfig(init_weights="bert"), ["loras.{name}."])

def test_lora_gradient_checkpointing_single_adapter(self):
def test_mtllora_gradient_checkpointing_single_adapter(self):
self.run_gradient_checkpointing_single_adapter_test(MTLLoRAConfig())

0 comments on commit 9781d4f

Please sign in to comment.