BentoML icon indicating copy to clipboard operation
BentoML copied to clipboard

feature: support huggingface peft on diffusers integration

Open Amitg1 opened this issue 2 years ago • 0 comments

Feature request

use peft to load and unload lora models.

Use pipe.enable_lora() or pipe.disable_lora() instead of pipe.load_lora_weights()` and pipe.unload_lora_weights()

Motivation

  • today bentoml diffusers code is using pipe.unload_lora_weights() which would be deprecated in the future and not recommended by hugging face.

from diffusers code: unload_lora_weights

if version.parse(version) > version.parse("0.23"): logger.warn( "You are using unload_lora_weights to disable and unload lora weights. If you want to iteratively enable and disable adapter weights," "you can use pipe.enable_lora() or pipe.disable_lora(). After installing the latest version of PEFT."

  • using unload_lora directly might cause errors with one encoder instead of two ( if using refiner)

Reference: https://github.com/huggingface/diffusers/issues/6377

Other

No response

Amitg1 avatar Jan 17 '24 15:01 Amitg1