Skip to content

Commit c129428

Browse files
committed
fix
1 parent 997e56c commit c129428

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/diffusers/models/modeling_utils.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -802,13 +802,7 @@ def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.P
802802
revision=revision,
803803
subfolder=subfolder or "",
804804
)
805-
if hf_quantizer is not None:
806-
is_torchao_quantization_method = quantization_config.quant_method == QuantizationMethod.TORCHAO
807-
if device_map is not None and is_torchao_quantization_method:
808-
raise NotImplementedError(
809-
"Loading sharded checkpoints, while passing `device_map`, is not supported with `torchao` quantization. This will be supported in the near future."
810-
)
811-
805+
if hf_quantizer is not None and is_bnb_quantization_method:
812806
model_file = _merge_sharded_checkpoints(sharded_ckpt_cached_folder, sharded_metadata)
813807
logger.info("Merged sharded checkpoints as `hf_quantizer` is not None.")
814808
is_sharded = False

0 commit comments

Comments
 (0)