Skip to content

Commit 126d84e

Browse files
committed
apply review suggestion
1 parent 7261559 commit 126d84e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/diffusers/models/model_loading_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ def load_model_dict_into_meta(
176176
hf_quantizer=None,
177177
keep_in_fp32_modules=None,
178178
) -> List[str]:
179+
if device is not None and not isinstance(device, (str, torch.device)):
180+
raise ValueError(f"Expected device to have type `str` or `torch.device`, but got {type(device)=}.")
179181
if hf_quantizer is None:
180182
device = device or torch.device("cpu")
181183
dtype = dtype or torch.float32

0 commit comments

Comments
 (0)