MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / unfuse_text_encoder_lora

Function unfuse_text_encoder_lora

diffusers/src/diffusers/loaders/lora_base.py:91–102  ·  view source on GitHub ↗

Unfuses LoRAs for the text encoder. Args: text_encoder (`torch.nn.Module`): The text encoder module to set the adapter layers for. If `None`, it will try to get the `text_encoder` attribute.

(text_encoder)

Source from the content-addressed store, hash-verified

89
90
91def unfuse_text_encoder_lora(text_encoder):
92 """
93 Unfuses LoRAs for the text encoder.
94
95 Args:
96 text_encoder (`torch.nn.Module`):
97 The text encoder module to set the adapter layers for. If `None`, it will try to get the `text_encoder`
98 attribute.
99 """
100 for module in text_encoder.modules():
101 if isinstance(module, BaseTunerLayer):
102 module.unmerge()
103
104
105def set_adapters_for_text_encoder(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected