Skip to content

Commit

Permalink
condition better.
Browse files Browse the repository at this point in the history
  • Loading branch information
sayakpaul committed Mar 10, 2025
1 parent 1d46b21 commit 30b1ef2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/diffusers/pipelines/pipeline_loading_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,11 @@ def load_sub_model(
else:
loading_kwargs["low_cpu_mem_usage"] = False

if quantization_config is not None and isinstance(quantization_config, PipelineQuantizationConfig):
if (
quantization_config is not None
and isinstance(quantization_config, PipelineQuantizationConfig)
and issubclass(class_obj, torch.nn.Module)
):
exclude_modules = quantization_config.exclude_modules or []
if name not in exclude_modules:
model_quant_config = _resolve_quant_config(quantization_config, is_diffusers=is_diffusers_model)
Expand Down

0 comments on commit 30b1ef2

Please sign in to comment.