Skip to content

Commit bbd0c16

Browse files
SunMarcsayakpaul
andauthored
[BNB] Fix test_moving_to_cpu_throws_warning (#11356)
fix Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
1 parent eef3d65 commit bbd0c16

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/diffusers/pipelines/pipeline_utils.py

+5
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,11 @@ def module_is_sequentially_offloaded(module):
404404
if not is_accelerate_available() or is_accelerate_version("<", "0.14.0"):
405405
return False
406406

407+
_, _, is_loaded_in_8bit_bnb = _check_bnb_status(module)
408+
409+
if is_loaded_in_8bit_bnb:
410+
return False
411+
407412
return hasattr(module, "_hf_hook") and (
408413
isinstance(module._hf_hook, accelerate.hooks.AlignDevicesHook)
409414
or hasattr(module._hf_hook, "hooks")

0 commit comments

Comments
 (0)