Skip to content

Commit 216b36c

Browse files
committed
Try to fix test failures affecting MacOS CI runners.
1 parent 8bf8742 commit 216b36c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tests/backend/flux/controlnet/test_state_dict_utils.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ def test_convert_diffusers_instantx_state_dict_to_bfl_format():
4848

4949
def test_infer_flux_params_from_state_dict():
5050
# Construct a dummy state_dict with tensors of the correct shape on the meta device.
51-
with torch.device("meta"):
52-
sd = {k: torch.zeros(v) for k, v in instantx_sd_shapes.items()}
51+
sd = {k: torch.zeros(v, device="meta") for k, v in instantx_sd_shapes.items()}
5352

5453
sd = convert_diffusers_instantx_state_dict_to_bfl_format(sd)
5554
flux_params = infer_flux_params_from_state_dict(sd)
@@ -70,8 +69,7 @@ def test_infer_flux_params_from_state_dict():
7069

7170
def test_infer_instantx_num_control_modes_from_state_dict():
7271
# Construct a dummy state_dict with tensors of the correct shape on the meta device.
73-
with torch.device("meta"):
74-
sd = {k: torch.zeros(v) for k, v in instantx_sd_shapes.items()}
72+
sd = {k: torch.zeros(v, device="meta") for k, v in instantx_sd_shapes.items()}
7573

7674
sd = convert_diffusers_instantx_state_dict_to_bfl_format(sd)
7775
num_control_modes = infer_instantx_num_control_modes_from_state_dict(sd)
@@ -81,8 +79,7 @@ def test_infer_instantx_num_control_modes_from_state_dict():
8179

8280
def test_load_instantx_from_state_dict():
8381
# Construct a dummy state_dict with tensors of the correct shape on the meta device.
84-
with torch.device("meta"):
85-
sd = {k: torch.zeros(v) for k, v in instantx_sd_shapes.items()}
82+
sd = {k: torch.zeros(v, device="meta") for k, v in instantx_sd_shapes.items()}
8683

8784
sd = convert_diffusers_instantx_state_dict_to_bfl_format(sd)
8885
flux_params = infer_flux_params_from_state_dict(sd)

0 commit comments

Comments
 (0)