Spaces:
Running on Zero
Running on Zero
Fall back to PyTorch attention when FA3 is unsupported
#4
by evalstate HF Staff - opened
app.py
CHANGED
|
@@ -50,7 +50,10 @@ pipe.fuse_lora(adapter_names=["angles"], lora_scale=1.25)
|
|
| 50 |
pipe.unload_lora_weights()
|
| 51 |
|
| 52 |
pipe.transformer.__class__ = QwenImageTransformer2DModel
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
optimize_pipeline_(
|
| 56 |
pipe,
|
|
|
|
| 50 |
pipe.unload_lora_weights()
|
| 51 |
|
| 52 |
pipe.transformer.__class__ = QwenImageTransformer2DModel
|
| 53 |
+
try:
|
| 54 |
+
pipe.transformer.set_attn_processor(QwenDoubleStreamAttnProcessorFA3())
|
| 55 |
+
except ImportError as error:
|
| 56 |
+
print(f"FlashAttention-3 is unavailable; using PyTorch attention instead: {error}")
|
| 57 |
|
| 58 |
optimize_pipeline_(
|
| 59 |
pipe,
|