Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/diffusers/models/attention_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,11 @@ def set_use_xla_flash_attention(
"""
if use_xla_flash_attention:
if not is_torch_xla_available:
raise "torch_xla is not available"
raise RuntimeError("torch_xla is not available")
elif is_torch_xla_version("<", "2.3"):
raise "flash attention pallas kernel is supported from torch_xla version 2.3"
raise RuntimeError("flash attention pallas kernel is supported from torch_xla version 2.3")
elif is_spmd() and is_torch_xla_version("<", "2.4"):
raise "flash attention pallas kernel using SPMD is supported from torch_xla version 2.4"
raise RuntimeError("flash attention pallas kernel using SPMD is supported from torch_xla version 2.4")
else:
if is_flux:
processor = XLAFluxFlashAttnProcessor2_0(partition_spec)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ def __call__(

control_image = control_images
else:
assert ValueError("Controlnet not found. Please check the controlnet model.")
raise ValueError("Controlnet not found. Please check the controlnet model.")

if controlnet_pooled_projections is None:
controlnet_pooled_projections = torch.zeros_like(pooled_prompt_embeds)
Expand Down