diffusers
diffusers copied to clipboard
device_map='balanced' pipe.load_textual_inversion() function error
hi https://github.com/huggingface/diffusers/blob/b934215d4c376ea2e08e28103443686b95ea772c/src/diffusers/loaders/textual_inversion.py#L458
The code at this reference does not seem to handle device_map='balanced' and will report an error
error msg:
diffusers\src\diffusers\pipelines\pipeline_utils.py", line 1130, in enable_sequential_cpu_offload
raise ValueError(
ValueError: It seems like you have activated a device mapping strategy on the pipeline so calling `enable_sequential_cpu_offload() isn't allowed. You can call `reset_device_map()` first and then call `enable_sequential_cpu_offload()`.
os:
diffusers==diffusers-0.28.0.dev0
this is my code:
pipe = StableDiffusionPipeline.from_pretrained(
"runwayml/stable-diffusion-v1-5",
variant="fp16",
safety_checker=None,
torch_dtype=torch.float16).to('cuda')
pipe.load_textual_inversion(EasyNegative.pt,
easynegative,
device_map='balanced',
torch.float16)
@sayakpaul
Thanks for reporting. Does https://github.com/huggingface/diffusers/pull/7919 solve the problem for you?
Thanks for reporting. Does #7919 solve the problem for you?
Yes, it solved my problem and I passed the test successfully, thank you very much
closing as fixed by @sayakpaul !