Skip to content
Merged
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
5 changes: 3 additions & 2 deletions optimum/habana/diffusers/pipelines/pipeline_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
from diffusers.utils.torch_utils import is_compiled_module
from huggingface_hub import create_repo

from optimum.habana.utils import to_device_dtype
from optimum.utils import logging

from ...transformers.gaudi_configuration import GaudiConfig
from ...utils import to_device_dtype


logger = logging.get_logger(__name__)
Expand Down Expand Up @@ -396,7 +396,8 @@ def save_lora_weights(
text_encoder_2_lora_layers = to_device_dtype(text_encoder_2_lora_layers, target_device=torch.device("cpu"))

# text_encoder_2_lora_layers is only supported by some diffuser pipelines
if text_encoder_2_lora_layers:
signature = inspect.signature(super().save_lora_weights)
if "text_encoder_2_lora_layers" in signature.parameters:
return super().save_lora_weights(
save_directory,
unet_lora_layers,
Expand Down