(self)
| 581 | set_adapters_for_text_encoder(adapter_names, model, _component_adapter_weights[component]) |
| 582 | |
| 583 | def disable_lora(self): |
| 584 | if not USE_PEFT_BACKEND: |
| 585 | raise ValueError("PEFT backend is required for this method.") |
| 586 | |
| 587 | for component in self._lora_loadable_modules: |
| 588 | model = getattr(self, component, None) |
| 589 | if model is not None: |
| 590 | if issubclass(model.__class__, ModelMixin): |
| 591 | model.disable_lora() |
| 592 | elif issubclass(model.__class__, PreTrainedModel): |
| 593 | disable_lora_for_text_encoder(model) |
| 594 | |
| 595 | def enable_lora(self): |
| 596 | if not USE_PEFT_BACKEND: |
nothing calls this directly
no test coverage detected