Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tests/lora/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def test_simple_inference_with_partial_text_lora(self):
state_dict = {
f"text_encoder.{module_name}": param
for module_name, param in get_peft_model_state_dict(pipe.text_encoder).items()
if "text_model.encoder.layers.4" not in module_name
if "encoder.layers.4" not in module_name
}

if self.has_two_text_encoders or self.has_three_text_encoders:
Expand All @@ -644,7 +644,7 @@ def test_simple_inference_with_partial_text_lora(self):
{
f"text_encoder_2.{module_name}": param
for module_name, param in get_peft_model_state_dict(pipe.text_encoder_2).items()
if "text_model.encoder.layers.4" not in module_name
if "encoder.layers.4" not in module_name
}
)

Expand Down Expand Up @@ -776,8 +776,9 @@ def test_simple_inference_with_text_denoiser_lora_and_scale(self):
)

if "text_encoder" in self.pipeline_class._lora_loadable_modules:
text_encoder_root = getattr(pipe.text_encoder, "text_model", pipe.text_encoder)
self.assertTrue(
pipe.text_encoder.text_model.encoder.layers[0].self_attn.q_proj.scaling["default"] == 1.0,
text_encoder_root.encoder.layers[0].self_attn.q_proj.scaling["default"] == 1.0,
"The scaling parameter has not been correctly restored!",
)

Expand Down
Loading