Skip to content

Commit 08782bf

Browse files
committed
handle offload_state_dict when initing transformers models (#12438)
1 parent 0f252be commit 08782bf

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
@@ -830,6 +830,9 @@ def load_sub_model(
830830
else:
831831
loading_kwargs["low_cpu_mem_usage"] = False
832832

833+
if is_transformers_model and is_transformers_version(">=", "4.57.0"):
834+
loading_kwargs.pop("offload_state_dict")
835+
833836
if (
834837
quantization_config is not None
835838
and isinstance(quantization_config, PipelineQuantizationConfig)

0 commit comments

Comments
 (0)