Skip to content

Commit 2d69bac

Browse files
authored
handle offload_state_dict when initing transformers models (#12438)
1 parent 0974b4c commit 2d69bac

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/diffusers/pipelines/pipeline_loading_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,9 @@ def load_sub_model(
838838
else:
839839
loading_kwargs["low_cpu_mem_usage"] = False
840840

841+
if is_transformers_model and is_transformers_version(">=", "4.57.0"):
842+
loading_kwargs.pop("offload_state_dict")
843+
841844
if (
842845
quantization_config is not None
843846
and isinstance(quantization_config, PipelineQuantizationConfig)

0 commit comments

Comments
 (0)