Skip to content

Commit f023991

Browse files
Update docstring to warn about device mismatch
1 parent 82a7f92 commit f023991

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/diffusers/loaders/lora_base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,10 @@ def set_lora_device(self, adapter_names: List[str], device: Union[torch.device,
934934
Moves the LoRAs listed in `adapter_names` to a target device. Useful for offloading the LoRA to the CPU in case
935935
you want to load multiple adapters and free some GPU memory.
936936
937+
After offloading the LoRA adapters to CPU, as long as the rest of the model is still on GPU, the LoRA adapters
938+
can no longer be used for inference, as that would cause a device mismatch. Remember to set the device back to
939+
GPU before using those LoRA adapters for inference.
940+
937941
Args:
938942
adapter_names (`List[str]`):
939943
List of adapters to send device to.

0 commit comments

Comments
 (0)